@rdmind/rdmind 0.0.28-alpha.7 → 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 +553 -541
- 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
|
|
|
@@ -301919,24 +301919,14 @@ async function autoSwitchToQSModel(config, settings) {
|
|
|
301919
301919
|
const targetModel = "qwen3-coder-480b-a35b-instruct";
|
|
301920
301920
|
const targetBaseUrl = "https://maas.devops.xiaohongshu.com/v1";
|
|
301921
301921
|
if (currentAuthType === "xhs-sso" /* XHS_SSO */) {
|
|
301922
|
-
const
|
|
301923
|
-
|
|
301924
|
-
|
|
301925
|
-
|
|
301926
|
-
|
|
301927
|
-
|
|
301928
|
-
|
|
301929
|
-
|
|
301930
|
-
refresh: true
|
|
301931
|
-
});
|
|
301932
|
-
} else {
|
|
301933
|
-
await applyXhsSsoConfig(config, settings, {
|
|
301934
|
-
apiKey,
|
|
301935
|
-
baseUrl: targetBaseUrl,
|
|
301936
|
-
model: targetModel,
|
|
301937
|
-
refresh: true
|
|
301938
|
-
});
|
|
301939
|
-
}
|
|
301922
|
+
const { fetchModelKey: fetchModelKey2 } = await Promise.resolve().then(() => (init_core2(), core_exports2));
|
|
301923
|
+
const newApiKey = await fetchModelKey2(targetModel, config.getDebugMode());
|
|
301924
|
+
await applyXhsSsoConfig(config, settings, {
|
|
301925
|
+
apiKey: newApiKey,
|
|
301926
|
+
baseUrl: targetBaseUrl,
|
|
301927
|
+
model: targetModel,
|
|
301928
|
+
refresh: true
|
|
301929
|
+
});
|
|
301940
301930
|
} else {
|
|
301941
301931
|
const { fetchModelKey: fetchModelKey2 } = await Promise.resolve().then(() => (init_core2(), core_exports2));
|
|
301942
301932
|
const apiKey = await fetchModelKey2(targetModel, config.getDebugMode());
|
|
@@ -301965,7 +301955,7 @@ init_esbuild_shims();
|
|
|
301965
301955
|
|
|
301966
301956
|
// packages/cli/src/gemini.tsx
|
|
301967
301957
|
init_esbuild_shims();
|
|
301968
|
-
var
|
|
301958
|
+
var import_react138 = __toESM(require_react(), 1);
|
|
301969
301959
|
|
|
301970
301960
|
// node_modules/ink/build/index.js
|
|
301971
301961
|
init_esbuild_shims();
|
|
@@ -308529,7 +308519,7 @@ var measure_element_default = measureElement;
|
|
|
308529
308519
|
|
|
308530
308520
|
// packages/cli/src/ui/AppContainer.tsx
|
|
308531
308521
|
init_esbuild_shims();
|
|
308532
|
-
var
|
|
308522
|
+
var import_react136 = __toESM(require_react(), 1);
|
|
308533
308523
|
|
|
308534
308524
|
// packages/cli/src/ui/App.tsx
|
|
308535
308525
|
init_esbuild_shims();
|
|
@@ -334650,6 +334640,7 @@ init_esbuild_shims();
|
|
|
334650
334640
|
|
|
334651
334641
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
334652
334642
|
init_esbuild_shims();
|
|
334643
|
+
var import_react68 = __toESM(require_react(), 1);
|
|
334653
334644
|
|
|
334654
334645
|
// packages/cli/src/ui/contexts/AppContext.tsx
|
|
334655
334646
|
init_esbuild_shims();
|
|
@@ -334679,10 +334670,31 @@ var UpdateNotification = /* @__PURE__ */ __name(({ message }) => /* @__PURE__ */
|
|
|
334679
334670
|
|
|
334680
334671
|
// packages/cli/src/ui/components/Notifications.tsx
|
|
334681
334672
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
|
|
334673
|
+
var L4_WARNING_AUTO_HIDE_DELAY = 3e3;
|
|
334682
334674
|
var Notifications = /* @__PURE__ */ __name(() => {
|
|
334683
334675
|
const { startupWarnings } = useAppContext();
|
|
334684
334676
|
const { initError, streamingState, updateInfo } = useUIState();
|
|
334685
|
-
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;
|
|
334686
334698
|
const showInitError = initError && streamingState !== "responding" /* Responding */;
|
|
334687
334699
|
if (!showStartupWarnings && !showInitError && !updateInfo) {
|
|
334688
334700
|
return null;
|
|
@@ -334697,7 +334709,7 @@ var Notifications = /* @__PURE__ */ __name(() => {
|
|
|
334697
334709
|
paddingX: 1,
|
|
334698
334710
|
marginY: 1,
|
|
334699
334711
|
flexDirection: "column",
|
|
334700
|
-
children:
|
|
334712
|
+
children: visibleWarnings.map((warning, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Text, { color: theme.status.warning, children: warning }, index))
|
|
334701
334713
|
}
|
|
334702
334714
|
),
|
|
334703
334715
|
showInitError && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
@@ -334817,7 +334829,7 @@ init_esbuild_shims();
|
|
|
334817
334829
|
|
|
334818
334830
|
// node_modules/ink-link/dist/index.js
|
|
334819
334831
|
init_esbuild_shims();
|
|
334820
|
-
var
|
|
334832
|
+
var import_react69 = __toESM(require_react(), 1);
|
|
334821
334833
|
var import_prop_types2 = __toESM(require_prop_types(), 1);
|
|
334822
334834
|
|
|
334823
334835
|
// node_modules/terminal-link/index.js
|
|
@@ -334965,10 +334977,10 @@ terminalLink.stderr.isSupported = import_supports_hyperlinks.default.stderr;
|
|
|
334965
334977
|
// node_modules/ink-link/dist/index.js
|
|
334966
334978
|
var Link = /* @__PURE__ */ __name(({ children, url: url2, fallback = true }) => (
|
|
334967
334979
|
// eslint-disable-line react/function-component-definition
|
|
334968
|
-
|
|
334980
|
+
import_react69.default.createElement(
|
|
334969
334981
|
Transform,
|
|
334970
334982
|
{ transform: /* @__PURE__ */ __name((children2) => terminalLink(children2, url2, { fallback }), "transform") },
|
|
334971
|
-
|
|
334983
|
+
import_react69.default.createElement(Text, null, children)
|
|
334972
334984
|
)
|
|
334973
334985
|
), "Link");
|
|
334974
334986
|
Link.propTypes = {
|
|
@@ -335242,7 +335254,7 @@ __name(LoopDetectionConfirmation, "LoopDetectionConfirmation");
|
|
|
335242
335254
|
|
|
335243
335255
|
// packages/cli/src/ui/components/FolderTrustDialog.tsx
|
|
335244
335256
|
init_esbuild_shims();
|
|
335245
|
-
var
|
|
335257
|
+
var import_react70 = __toESM(require_react(), 1);
|
|
335246
335258
|
import * as process26 from "node:process";
|
|
335247
335259
|
import * as path65 from "node:path";
|
|
335248
335260
|
|
|
@@ -335297,7 +335309,7 @@ var FolderTrustDialog = /* @__PURE__ */ __name(({
|
|
|
335297
335309
|
onSelect,
|
|
335298
335310
|
isRestarting
|
|
335299
335311
|
}) => {
|
|
335300
|
-
(0,
|
|
335312
|
+
(0, import_react70.useEffect)(() => {
|
|
335301
335313
|
const doRelaunch = /* @__PURE__ */ __name(async () => {
|
|
335302
335314
|
if (isRestarting) {
|
|
335303
335315
|
setTimeout(async () => {
|
|
@@ -335436,7 +335448,7 @@ var ShellConfirmationDialog = /* @__PURE__ */ __name(({ request: request4 }) =>
|
|
|
335436
335448
|
|
|
335437
335449
|
// packages/cli/src/ui/components/ConsentPrompt.tsx
|
|
335438
335450
|
init_esbuild_shims();
|
|
335439
|
-
var
|
|
335451
|
+
var import_react71 = __toESM(require_react(), 1);
|
|
335440
335452
|
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
335441
335453
|
var ConsentPrompt = /* @__PURE__ */ __name((props) => {
|
|
335442
335454
|
const { prompt, onConfirm, terminalWidth } = props;
|
|
@@ -335474,7 +335486,7 @@ var ConsentPrompt = /* @__PURE__ */ __name((props) => {
|
|
|
335474
335486
|
|
|
335475
335487
|
// packages/cli/src/ui/components/ThemeDialog.tsx
|
|
335476
335488
|
init_esbuild_shims();
|
|
335477
|
-
var
|
|
335489
|
+
var import_react72 = __toESM(require_react(), 1);
|
|
335478
335490
|
init_settings();
|
|
335479
335491
|
|
|
335480
335492
|
// packages/cli/src/utils/dialogScopeUtils.ts
|
|
@@ -335734,10 +335746,10 @@ function ThemeDialog({
|
|
|
335734
335746
|
availableTerminalHeight,
|
|
335735
335747
|
terminalWidth
|
|
335736
335748
|
}) {
|
|
335737
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
335749
|
+
const [selectedScope, setSelectedScope] = (0, import_react72.useState)(
|
|
335738
335750
|
"User" /* User */
|
|
335739
335751
|
);
|
|
335740
|
-
const [highlightedThemeName, setHighlightedThemeName] = (0,
|
|
335752
|
+
const [highlightedThemeName, setHighlightedThemeName] = (0, import_react72.useState)(settings.merged.ui?.theme || DEFAULT_THEME.name);
|
|
335741
335753
|
const customThemes = selectedScope === "User" /* User */ ? settings.user.settings.ui?.customThemes || {} : settings.merged.ui?.customThemes || {};
|
|
335742
335754
|
const builtInThemes = themeManager.getAvailableThemes().filter((theme2) => theme2.type !== "custom");
|
|
335743
335755
|
const customThemeNames = Object.keys(customThemes);
|
|
@@ -335762,7 +335774,7 @@ function ThemeDialog({
|
|
|
335762
335774
|
(item) => item.value === highlightedThemeName
|
|
335763
335775
|
);
|
|
335764
335776
|
const safeInitialThemeIndex = initialThemeIndex >= 0 ? initialThemeIndex : 0;
|
|
335765
|
-
const handleThemeSelect = (0,
|
|
335777
|
+
const handleThemeSelect = (0, import_react72.useCallback)(
|
|
335766
335778
|
(themeName) => {
|
|
335767
335779
|
onSelect(themeName, selectedScope);
|
|
335768
335780
|
},
|
|
@@ -335772,16 +335784,16 @@ function ThemeDialog({
|
|
|
335772
335784
|
setHighlightedThemeName(themeName);
|
|
335773
335785
|
onHighlight(themeName);
|
|
335774
335786
|
}, "handleThemeHighlight");
|
|
335775
|
-
const handleScopeHighlight = (0,
|
|
335787
|
+
const handleScopeHighlight = (0, import_react72.useCallback)((scope) => {
|
|
335776
335788
|
setSelectedScope(scope);
|
|
335777
335789
|
}, []);
|
|
335778
|
-
const handleScopeSelect = (0,
|
|
335790
|
+
const handleScopeSelect = (0, import_react72.useCallback)(
|
|
335779
335791
|
(scope) => {
|
|
335780
335792
|
onSelect(highlightedThemeName, scope);
|
|
335781
335793
|
},
|
|
335782
335794
|
[onSelect, highlightedThemeName]
|
|
335783
335795
|
);
|
|
335784
|
-
const [mode, setMode] = (0,
|
|
335796
|
+
const [mode, setMode] = (0, import_react72.useState)("theme");
|
|
335785
335797
|
useKeypress(
|
|
335786
335798
|
(key) => {
|
|
335787
335799
|
if (key.name === "tab") {
|
|
@@ -335938,32 +335950,32 @@ __name(ThemeDialog, "ThemeDialog");
|
|
|
335938
335950
|
|
|
335939
335951
|
// packages/cli/src/ui/components/SettingsDialog.tsx
|
|
335940
335952
|
init_esbuild_shims();
|
|
335941
|
-
var
|
|
335953
|
+
var import_react74 = __toESM(require_react(), 1);
|
|
335942
335954
|
init_settings();
|
|
335943
335955
|
|
|
335944
335956
|
// packages/cli/src/ui/contexts/VimModeContext.tsx
|
|
335945
335957
|
init_esbuild_shims();
|
|
335946
|
-
var
|
|
335958
|
+
var import_react73 = __toESM(require_react(), 1);
|
|
335947
335959
|
init_settings();
|
|
335948
335960
|
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
335949
|
-
var VimModeContext = (0,
|
|
335961
|
+
var VimModeContext = (0, import_react73.createContext)(void 0);
|
|
335950
335962
|
var VimModeProvider = /* @__PURE__ */ __name(({
|
|
335951
335963
|
children,
|
|
335952
335964
|
settings
|
|
335953
335965
|
}) => {
|
|
335954
335966
|
const initialVimEnabled = settings.merged.general?.vimMode ?? false;
|
|
335955
|
-
const [vimEnabled, setVimEnabled] = (0,
|
|
335956
|
-
const [vimMode, setVimMode] = (0,
|
|
335967
|
+
const [vimEnabled, setVimEnabled] = (0, import_react73.useState)(initialVimEnabled);
|
|
335968
|
+
const [vimMode, setVimMode] = (0, import_react73.useState)(
|
|
335957
335969
|
initialVimEnabled ? "NORMAL" : "INSERT"
|
|
335958
335970
|
);
|
|
335959
|
-
(0,
|
|
335971
|
+
(0, import_react73.useEffect)(() => {
|
|
335960
335972
|
const enabled = settings.merged.general?.vimMode ?? false;
|
|
335961
335973
|
setVimEnabled(enabled);
|
|
335962
335974
|
if (enabled) {
|
|
335963
335975
|
setVimMode("NORMAL");
|
|
335964
335976
|
}
|
|
335965
335977
|
}, [settings.merged.general?.vimMode]);
|
|
335966
|
-
const toggleVimEnabled = (0,
|
|
335978
|
+
const toggleVimEnabled = (0, import_react73.useCallback)(async () => {
|
|
335967
335979
|
const newValue = !vimEnabled;
|
|
335968
335980
|
setVimEnabled(newValue);
|
|
335969
335981
|
if (newValue) {
|
|
@@ -335981,7 +335993,7 @@ var VimModeProvider = /* @__PURE__ */ __name(({
|
|
|
335981
335993
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(VimModeContext.Provider, { value, children });
|
|
335982
335994
|
}, "VimModeProvider");
|
|
335983
335995
|
var useVimMode = /* @__PURE__ */ __name(() => {
|
|
335984
|
-
const context2 = (0,
|
|
335996
|
+
const context2 = (0, import_react73.useContext)(VimModeContext);
|
|
335985
335997
|
if (context2 === void 0) {
|
|
335986
335998
|
throw new Error("useVimMode must be used within a VimModeProvider");
|
|
335987
335999
|
}
|
|
@@ -336002,27 +336014,27 @@ function SettingsDialog({
|
|
|
336002
336014
|
config
|
|
336003
336015
|
}) {
|
|
336004
336016
|
const { vimEnabled, toggleVimEnabled } = useVimMode();
|
|
336005
|
-
const [focusSection, setFocusSection] = (0,
|
|
336017
|
+
const [focusSection, setFocusSection] = (0, import_react74.useState)(
|
|
336006
336018
|
"settings"
|
|
336007
336019
|
);
|
|
336008
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
336020
|
+
const [selectedScope, setSelectedScope] = (0, import_react74.useState)(
|
|
336009
336021
|
"User" /* User */
|
|
336010
336022
|
);
|
|
336011
|
-
const [activeSettingIndex, setActiveSettingIndex] = (0,
|
|
336012
|
-
const [scrollOffset, setScrollOffset] = (0,
|
|
336013
|
-
const [showRestartPrompt, setShowRestartPrompt] = (0,
|
|
336014
|
-
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)(
|
|
336015
336027
|
() => (
|
|
336016
336028
|
// Deep clone to avoid mutation
|
|
336017
336029
|
structuredClone(settings.forScope(selectedScope).settings)
|
|
336018
336030
|
)
|
|
336019
336031
|
);
|
|
336020
|
-
const [modifiedSettings, setModifiedSettings] = (0,
|
|
336032
|
+
const [modifiedSettings, setModifiedSettings] = (0, import_react74.useState)(
|
|
336021
336033
|
/* @__PURE__ */ new Set()
|
|
336022
336034
|
);
|
|
336023
|
-
const [globalPendingChanges, setGlobalPendingChanges] = (0,
|
|
336024
|
-
const [_restartRequiredSettings, setRestartRequiredSettings] = (0,
|
|
336025
|
-
(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)(() => {
|
|
336026
336038
|
let updated = structuredClone(settings.forScope(selectedScope).settings);
|
|
336027
336039
|
const newModified = /* @__PURE__ */ new Set();
|
|
336028
336040
|
const newRestartRequired = /* @__PURE__ */ new Set();
|
|
@@ -336157,11 +336169,11 @@ function SettingsDialog({
|
|
|
336157
336169
|
});
|
|
336158
336170
|
}, "generateSettingsItems");
|
|
336159
336171
|
const items = generateSettingsItems();
|
|
336160
|
-
const [editingKey, setEditingKey] = (0,
|
|
336161
|
-
const [editBuffer, setEditBuffer] = (0,
|
|
336162
|
-
const [editCursorPos, setEditCursorPos] = (0,
|
|
336163
|
-
const [cursorVisible, setCursorVisible] = (0,
|
|
336164
|
-
(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)(() => {
|
|
336165
336177
|
if (!editingKey) {
|
|
336166
336178
|
setCursorVisible(true);
|
|
336167
336179
|
return;
|
|
@@ -336298,7 +336310,7 @@ function SettingsDialog({
|
|
|
336298
336310
|
maxVisibleItems = Math.max(1, Math.floor(availableHeightForSettings / 2));
|
|
336299
336311
|
}
|
|
336300
336312
|
const effectiveMaxItemsToShow = availableTerminalHeight ? Math.min(maxVisibleItems, items.length) : maxItemsToShow;
|
|
336301
|
-
|
|
336313
|
+
import_react74.default.useEffect(() => {
|
|
336302
336314
|
if (!showScopeSelection && focusSection === "scope") {
|
|
336303
336315
|
setFocusSection("settings");
|
|
336304
336316
|
}
|
|
@@ -336606,7 +336618,7 @@ function SettingsDialog({
|
|
|
336606
336618
|
selectedScope,
|
|
336607
336619
|
settings
|
|
336608
336620
|
);
|
|
336609
|
-
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(
|
|
336621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_react74.default.Fragment, { children: [
|
|
336610
336622
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Box_default, { flexDirection: "row", alignItems: "center", children: [
|
|
336611
336623
|
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Box_default, { minWidth: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
336612
336624
|
Text,
|
|
@@ -336666,7 +336678,7 @@ __name(SettingsDialog, "SettingsDialog");
|
|
|
336666
336678
|
|
|
336667
336679
|
// packages/cli/src/ui/components/QwenOAuthProgress.tsx
|
|
336668
336680
|
init_esbuild_shims();
|
|
336669
|
-
var
|
|
336681
|
+
var import_react75 = __toESM(require_react(), 1);
|
|
336670
336682
|
var import_qrcode_terminal = __toESM(require_main2(), 1);
|
|
336671
336683
|
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
|
|
336672
336684
|
function QrCodeDisplay({
|
|
@@ -336738,9 +336750,9 @@ function QwenOAuthProgress({
|
|
|
336738
336750
|
authMessage
|
|
336739
336751
|
}) {
|
|
336740
336752
|
const defaultTimeout = deviceAuth?.expires_in || 300;
|
|
336741
|
-
const [timeRemaining, setTimeRemaining] = (0,
|
|
336742
|
-
const [dots, setDots] = (0,
|
|
336743
|
-
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);
|
|
336744
336756
|
useKeypress(
|
|
336745
336757
|
(key) => {
|
|
336746
336758
|
if (authStatus === "timeout" || authStatus === "error") {
|
|
@@ -336751,7 +336763,7 @@ function QwenOAuthProgress({
|
|
|
336751
336763
|
},
|
|
336752
336764
|
{ isActive: true }
|
|
336753
336765
|
);
|
|
336754
|
-
(0,
|
|
336766
|
+
(0, import_react75.useEffect)(() => {
|
|
336755
336767
|
if (!deviceAuth?.verification_uri_complete) {
|
|
336756
336768
|
return;
|
|
336757
336769
|
}
|
|
@@ -336771,7 +336783,7 @@ function QwenOAuthProgress({
|
|
|
336771
336783
|
}, "generateQR");
|
|
336772
336784
|
generateQR();
|
|
336773
336785
|
}, [deviceAuth?.verification_uri_complete]);
|
|
336774
|
-
(0,
|
|
336786
|
+
(0, import_react75.useEffect)(() => {
|
|
336775
336787
|
const timer = setInterval(() => {
|
|
336776
336788
|
setTimeRemaining((prev) => {
|
|
336777
336789
|
if (prev <= 1) {
|
|
@@ -336783,7 +336795,7 @@ function QwenOAuthProgress({
|
|
|
336783
336795
|
}, 1e3);
|
|
336784
336796
|
return () => clearInterval(timer);
|
|
336785
336797
|
}, [onTimeout]);
|
|
336786
|
-
(0,
|
|
336798
|
+
(0, import_react75.useEffect)(() => {
|
|
336787
336799
|
const dotsTimer = setInterval(() => {
|
|
336788
336800
|
setDots((prev) => {
|
|
336789
336801
|
if (prev.length >= 3) return "";
|
|
@@ -336792,7 +336804,7 @@ function QwenOAuthProgress({
|
|
|
336792
336804
|
}, 500);
|
|
336793
336805
|
return () => clearInterval(dotsTimer);
|
|
336794
336806
|
}, []);
|
|
336795
|
-
const qrCodeDisplay = (0,
|
|
336807
|
+
const qrCodeDisplay = (0, import_react75.useMemo)(() => {
|
|
336796
336808
|
if (!deviceAuth?.verification_uri_complete) return null;
|
|
336797
336809
|
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
336798
336810
|
QrCodeDisplay,
|
|
@@ -336872,13 +336884,13 @@ __name(QwenOAuthProgress, "QwenOAuthProgress");
|
|
|
336872
336884
|
|
|
336873
336885
|
// packages/cli/src/ui/auth/AuthDialog.tsx
|
|
336874
336886
|
init_esbuild_shims();
|
|
336875
|
-
var
|
|
336887
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
336876
336888
|
init_core2();
|
|
336877
336889
|
init_settings();
|
|
336878
336890
|
|
|
336879
336891
|
// packages/cli/src/ui/contexts/UIActionsContext.tsx
|
|
336880
336892
|
init_esbuild_shims();
|
|
336881
|
-
var
|
|
336893
|
+
var import_react77 = __toESM(require_react(), 1);
|
|
336882
336894
|
init_core2();
|
|
336883
336895
|
init_settings();
|
|
336884
336896
|
|
|
@@ -336948,7 +336960,7 @@ var ModelSwitchDialog = /* @__PURE__ */ __name(({
|
|
|
336948
336960
|
|
|
336949
336961
|
// packages/cli/src/ui/components/OpenAIKeyPrompt.tsx
|
|
336950
336962
|
init_esbuild_shims();
|
|
336951
|
-
var
|
|
336963
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
336952
336964
|
init_zod();
|
|
336953
336965
|
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
|
|
336954
336966
|
var credentialSchema = external_exports.object({
|
|
@@ -336963,11 +336975,11 @@ function OpenAIKeyPrompt({
|
|
|
336963
336975
|
defaultBaseUrl,
|
|
336964
336976
|
defaultModel
|
|
336965
336977
|
}) {
|
|
336966
|
-
const [apiKey, setApiKey] = (0,
|
|
336967
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
336968
|
-
const [model, setModel] = (0,
|
|
336969
|
-
const [currentField, setCurrentField] = (0,
|
|
336970
|
-
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);
|
|
336971
336983
|
const validateAndSubmit = /* @__PURE__ */ __name(() => {
|
|
336972
336984
|
setValidationError(null);
|
|
336973
336985
|
try {
|
|
@@ -337140,9 +337152,9 @@ function OpenAIKeyPrompt({
|
|
|
337140
337152
|
__name(OpenAIKeyPrompt, "OpenAIKeyPrompt");
|
|
337141
337153
|
|
|
337142
337154
|
// packages/cli/src/ui/contexts/UIActionsContext.tsx
|
|
337143
|
-
var UIActionsContext = (0,
|
|
337155
|
+
var UIActionsContext = (0, import_react77.createContext)(null);
|
|
337144
337156
|
var useUIActions = /* @__PURE__ */ __name(() => {
|
|
337145
|
-
const context2 = (0,
|
|
337157
|
+
const context2 = (0, import_react77.useContext)(UIActionsContext);
|
|
337146
337158
|
if (!context2) {
|
|
337147
337159
|
throw new Error("useUIActions must be used within a UIActionsProvider");
|
|
337148
337160
|
}
|
|
@@ -337162,8 +337174,8 @@ function AuthDialog() {
|
|
|
337162
337174
|
const { pendingAuthType, authError } = useUIState();
|
|
337163
337175
|
const { handleAuthSelect: onAuthSelect } = useUIActions();
|
|
337164
337176
|
const settings = useSettings();
|
|
337165
|
-
const [errorMessage, setErrorMessage] = (0,
|
|
337166
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
337177
|
+
const [errorMessage, setErrorMessage] = (0, import_react78.useState)(null);
|
|
337178
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react78.useState)(null);
|
|
337167
337179
|
const items = [
|
|
337168
337180
|
{ key: "xhs-sso" /* XHS_SSO */, label: "\u5C0F\u7EA2\u4E66 SSO", value: "xhs-sso" /* XHS_SSO */ },
|
|
337169
337181
|
{
|
|
@@ -337251,7 +337263,7 @@ __name(AuthDialog, "AuthDialog");
|
|
|
337251
337263
|
|
|
337252
337264
|
// packages/cli/src/ui/components/EditorSettingsDialog.tsx
|
|
337253
337265
|
init_esbuild_shims();
|
|
337254
|
-
var
|
|
337266
|
+
var import_react79 = __toESM(require_react(), 1);
|
|
337255
337267
|
|
|
337256
337268
|
// packages/cli/src/ui/editors/editorSettingsManager.ts
|
|
337257
337269
|
init_esbuild_shims();
|
|
@@ -337310,10 +337322,10 @@ function EditorSettingsDialog({
|
|
|
337310
337322
|
settings,
|
|
337311
337323
|
onExit
|
|
337312
337324
|
}) {
|
|
337313
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
337325
|
+
const [selectedScope, setSelectedScope] = (0, import_react79.useState)(
|
|
337314
337326
|
"User" /* User */
|
|
337315
337327
|
);
|
|
337316
|
-
const [focusedSection, setFocusedSection] = (0,
|
|
337328
|
+
const [focusedSection, setFocusedSection] = (0, import_react79.useState)(
|
|
337317
337329
|
"editor"
|
|
337318
337330
|
);
|
|
337319
337331
|
useKeypress(
|
|
@@ -337444,12 +337456,12 @@ __name(EditorSettingsDialog, "EditorSettingsDialog");
|
|
|
337444
337456
|
// packages/cli/src/ui/components/WorkspaceMigrationDialog.tsx
|
|
337445
337457
|
init_esbuild_shims();
|
|
337446
337458
|
init_extension();
|
|
337447
|
-
var
|
|
337459
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
337448
337460
|
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
|
|
337449
337461
|
function WorkspaceMigrationDialog(props) {
|
|
337450
337462
|
const { workspaceExtensions, onOpen, onClose } = props;
|
|
337451
|
-
const [migrationComplete, setMigrationComplete] = (0,
|
|
337452
|
-
const [failedExtensions, setFailedExtensions] = (0,
|
|
337463
|
+
const [migrationComplete, setMigrationComplete] = (0, import_react80.useState)(false);
|
|
337464
|
+
const [failedExtensions, setFailedExtensions] = (0, import_react80.useState)([]);
|
|
337453
337465
|
onOpen();
|
|
337454
337466
|
const onMigrate = /* @__PURE__ */ __name(async () => {
|
|
337455
337467
|
const failed = await performWorkspaceExtensionMigration(
|
|
@@ -337574,7 +337586,7 @@ init_trustedFolders();
|
|
|
337574
337586
|
|
|
337575
337587
|
// packages/cli/src/ui/hooks/usePermissionsModifyTrust.ts
|
|
337576
337588
|
init_esbuild_shims();
|
|
337577
|
-
var
|
|
337589
|
+
var import_react81 = __toESM(require_react(), 1);
|
|
337578
337590
|
init_trustedFolders();
|
|
337579
337591
|
import * as process28 from "node:process";
|
|
337580
337592
|
function getInitialTrustState(settings, cwd7) {
|
|
@@ -337592,20 +337604,20 @@ __name(getInitialTrustState, "getInitialTrustState");
|
|
|
337592
337604
|
var usePermissionsModifyTrust = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
337593
337605
|
const settings = useSettings();
|
|
337594
337606
|
const cwd7 = process28.cwd();
|
|
337595
|
-
const [initialState2] = (0,
|
|
337596
|
-
const [currentTrustLevel] = (0,
|
|
337607
|
+
const [initialState2] = (0, import_react81.useState)(() => getInitialTrustState(settings, cwd7));
|
|
337608
|
+
const [currentTrustLevel] = (0, import_react81.useState)(
|
|
337597
337609
|
initialState2.currentTrustLevel
|
|
337598
337610
|
);
|
|
337599
|
-
const [pendingTrustLevel, setPendingTrustLevel] = (0,
|
|
337600
|
-
const [isInheritedTrustFromParent] = (0,
|
|
337611
|
+
const [pendingTrustLevel, setPendingTrustLevel] = (0, import_react81.useState)();
|
|
337612
|
+
const [isInheritedTrustFromParent] = (0, import_react81.useState)(
|
|
337601
337613
|
initialState2.isInheritedTrustFromParent
|
|
337602
337614
|
);
|
|
337603
|
-
const [isInheritedTrustFromIde] = (0,
|
|
337615
|
+
const [isInheritedTrustFromIde] = (0, import_react81.useState)(
|
|
337604
337616
|
initialState2.isInheritedTrustFromIde
|
|
337605
337617
|
);
|
|
337606
|
-
const [needsRestart, setNeedsRestart] = (0,
|
|
337618
|
+
const [needsRestart, setNeedsRestart] = (0, import_react81.useState)(false);
|
|
337607
337619
|
const isFolderTrustEnabled2 = !!settings.merged.security?.folderTrust?.enabled;
|
|
337608
|
-
const updateTrustLevel = (0,
|
|
337620
|
+
const updateTrustLevel = (0, import_react81.useCallback)(
|
|
337609
337621
|
(trustLevel) => {
|
|
337610
337622
|
const wasTrusted = isWorkspaceTrusted(settings.merged).isTrusted;
|
|
337611
337623
|
const currentConfig = loadTrustedFolders().user.config;
|
|
@@ -337638,7 +337650,7 @@ var usePermissionsModifyTrust = /* @__PURE__ */ __name((onExit, addItem) => {
|
|
|
337638
337650
|
},
|
|
337639
337651
|
[cwd7, settings.merged, onExit, addItem]
|
|
337640
337652
|
);
|
|
337641
|
-
const commitTrustLevelChange = (0,
|
|
337653
|
+
const commitTrustLevelChange = (0, import_react81.useCallback)(() => {
|
|
337642
337654
|
if (pendingTrustLevel) {
|
|
337643
337655
|
const folders = loadTrustedFolders();
|
|
337644
337656
|
folders.setValue(cwd7, pendingTrustLevel);
|
|
@@ -337751,7 +337763,7 @@ __name(PermissionsModifyTrustDialog, "PermissionsModifyTrustDialog");
|
|
|
337751
337763
|
|
|
337752
337764
|
// packages/cli/src/ui/components/ModelDialog.tsx
|
|
337753
337765
|
init_esbuild_shims();
|
|
337754
|
-
var
|
|
337766
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
337755
337767
|
|
|
337756
337768
|
// packages/cli/src/ui/components/shared/DescriptiveRadioButtonSelect.tsx
|
|
337757
337769
|
init_esbuild_shims();
|
|
@@ -337835,7 +337847,7 @@ __name(isVisionModel, "isVisionModel");
|
|
|
337835
337847
|
|
|
337836
337848
|
// packages/cli/src/ui/components/XhsSsoModelConfigFlow.tsx
|
|
337837
337849
|
init_esbuild_shims();
|
|
337838
|
-
var
|
|
337850
|
+
var import_react82 = __toESM(require_react(), 1);
|
|
337839
337851
|
|
|
337840
337852
|
// packages/cli/src/config/xhsSsoProviders.ts
|
|
337841
337853
|
init_esbuild_shims();
|
|
@@ -337871,9 +337883,9 @@ function XhsSsoModelConfigFlow({
|
|
|
337871
337883
|
onCancel,
|
|
337872
337884
|
rdmindSsoId
|
|
337873
337885
|
}) {
|
|
337874
|
-
const config = (0,
|
|
337875
|
-
const [isLoading, setIsLoading] = (0,
|
|
337876
|
-
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);
|
|
337877
337889
|
useKeypress(
|
|
337878
337890
|
(key) => {
|
|
337879
337891
|
if (key.name === "escape" && !isLoading) {
|
|
@@ -337882,7 +337894,7 @@ function XhsSsoModelConfigFlow({
|
|
|
337882
337894
|
},
|
|
337883
337895
|
{ isActive: true }
|
|
337884
337896
|
);
|
|
337885
|
-
const modelItems = (0,
|
|
337897
|
+
const modelItems = (0, import_react82.useMemo)(
|
|
337886
337898
|
() => XHS_SSO_MODELS.map((model) => ({
|
|
337887
337899
|
key: model.id,
|
|
337888
337900
|
value: model,
|
|
@@ -337892,7 +337904,7 @@ function XhsSsoModelConfigFlow({
|
|
|
337892
337904
|
[]
|
|
337893
337905
|
);
|
|
337894
337906
|
const currentModel = config?.getModel();
|
|
337895
|
-
const initialIndex = (0,
|
|
337907
|
+
const initialIndex = (0, import_react82.useMemo)(() => {
|
|
337896
337908
|
if (!currentModel) {
|
|
337897
337909
|
return 0;
|
|
337898
337910
|
}
|
|
@@ -337982,14 +337994,14 @@ init_settings();
|
|
|
337982
337994
|
init_core2();
|
|
337983
337995
|
var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
|
|
337984
337996
|
function ModelDialog({ onClose }) {
|
|
337985
|
-
const config = (0,
|
|
337986
|
-
const settings = (0,
|
|
337997
|
+
const config = (0, import_react83.useContext)(ConfigContext);
|
|
337998
|
+
const settings = (0, import_react83.useContext)(SettingsContext);
|
|
337987
337999
|
const authType = config?.getAuthType() ?? "qwen-oauth" /* QWEN_OAUTH */;
|
|
337988
|
-
const availableModels = (0,
|
|
338000
|
+
const availableModels = (0, import_react83.useMemo)(
|
|
337989
338001
|
() => getAvailableModelsForAuthType(authType),
|
|
337990
338002
|
[authType]
|
|
337991
338003
|
);
|
|
337992
|
-
const MODEL_OPTIONS = (0,
|
|
338004
|
+
const MODEL_OPTIONS = (0, import_react83.useMemo)(
|
|
337993
338005
|
() => availableModels.map((model) => ({
|
|
337994
338006
|
value: model.id,
|
|
337995
338007
|
title: model.label,
|
|
@@ -337999,11 +338011,11 @@ function ModelDialog({ onClose }) {
|
|
|
337999
338011
|
[availableModels]
|
|
338000
338012
|
);
|
|
338001
338013
|
const preferredModel = config?.getModel() || MAINLINE_CODER;
|
|
338002
|
-
const initialIndex = (0,
|
|
338014
|
+
const initialIndex = (0, import_react83.useMemo)(
|
|
338003
338015
|
() => MODEL_OPTIONS.findIndex((option2) => option2.value === preferredModel),
|
|
338004
338016
|
[MODEL_OPTIONS, preferredModel]
|
|
338005
338017
|
);
|
|
338006
|
-
const handleSelect = (0,
|
|
338018
|
+
const handleSelect = (0, import_react83.useCallback)(
|
|
338007
338019
|
(model) => {
|
|
338008
338020
|
if (config) {
|
|
338009
338021
|
config.setModel(model);
|
|
@@ -338022,7 +338034,7 @@ function ModelDialog({ onClose }) {
|
|
|
338022
338034
|
},
|
|
338023
338035
|
{ isActive: true }
|
|
338024
338036
|
);
|
|
338025
|
-
const handleOpenAIConfigSubmit = (0,
|
|
338037
|
+
const handleOpenAIConfigSubmit = (0, import_react83.useCallback)(
|
|
338026
338038
|
async (apiKey, baseUrl, model) => {
|
|
338027
338039
|
if (config && settings) {
|
|
338028
338040
|
config.updateCredentials({
|
|
@@ -338047,7 +338059,7 @@ function ModelDialog({ onClose }) {
|
|
|
338047
338059
|
},
|
|
338048
338060
|
[config, settings, onClose]
|
|
338049
338061
|
);
|
|
338050
|
-
const handleXhsSsoConfigComplete = (0,
|
|
338062
|
+
const handleXhsSsoConfigComplete = (0, import_react83.useCallback)(
|
|
338051
338063
|
async (xhsSsoConfig) => {
|
|
338052
338064
|
if (config && settings) {
|
|
338053
338065
|
config.updateCredentials({
|
|
@@ -338119,7 +338131,7 @@ __name(ModelDialog, "ModelDialog");
|
|
|
338119
338131
|
|
|
338120
338132
|
// packages/cli/src/ui/components/ApprovalModeDialog.tsx
|
|
338121
338133
|
init_esbuild_shims();
|
|
338122
|
-
var
|
|
338134
|
+
var import_react84 = __toESM(require_react(), 1);
|
|
338123
338135
|
init_core2();
|
|
338124
338136
|
init_settings();
|
|
338125
338137
|
var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -338143,10 +338155,10 @@ function ApprovalModeDialog({
|
|
|
338143
338155
|
currentMode,
|
|
338144
338156
|
availableTerminalHeight: _availableTerminalHeight
|
|
338145
338157
|
}) {
|
|
338146
|
-
const [selectedScope, setSelectedScope] = (0,
|
|
338158
|
+
const [selectedScope, setSelectedScope] = (0, import_react84.useState)(
|
|
338147
338159
|
"User" /* User */
|
|
338148
338160
|
);
|
|
338149
|
-
const [highlightedMode, setHighlightedMode] = (0,
|
|
338161
|
+
const [highlightedMode, setHighlightedMode] = (0, import_react84.useState)(
|
|
338150
338162
|
currentMode || "default" /* DEFAULT */
|
|
338151
338163
|
);
|
|
338152
338164
|
const modeItems = APPROVAL_MODES.map((mode) => ({
|
|
@@ -338158,7 +338170,7 @@ function ApprovalModeDialog({
|
|
|
338158
338170
|
(item) => item.value === highlightedMode
|
|
338159
338171
|
);
|
|
338160
338172
|
const safeInitialModeIndex = initialModeIndex >= 0 ? initialModeIndex : 0;
|
|
338161
|
-
const handleModeSelect = (0,
|
|
338173
|
+
const handleModeSelect = (0, import_react84.useCallback)(
|
|
338162
338174
|
(mode) => {
|
|
338163
338175
|
onSelect(mode, selectedScope);
|
|
338164
338176
|
},
|
|
@@ -338167,16 +338179,16 @@ function ApprovalModeDialog({
|
|
|
338167
338179
|
const handleModeHighlight = /* @__PURE__ */ __name((mode) => {
|
|
338168
338180
|
setHighlightedMode(mode);
|
|
338169
338181
|
}, "handleModeHighlight");
|
|
338170
|
-
const handleScopeHighlight = (0,
|
|
338182
|
+
const handleScopeHighlight = (0, import_react84.useCallback)((scope) => {
|
|
338171
338183
|
setSelectedScope(scope);
|
|
338172
338184
|
}, []);
|
|
338173
|
-
const handleScopeSelect = (0,
|
|
338185
|
+
const handleScopeSelect = (0, import_react84.useCallback)(
|
|
338174
338186
|
(scope) => {
|
|
338175
338187
|
onSelect(highlightedMode, scope);
|
|
338176
338188
|
},
|
|
338177
338189
|
[onSelect, highlightedMode]
|
|
338178
338190
|
);
|
|
338179
|
-
const [focusSection, setFocusSection] = (0,
|
|
338191
|
+
const [focusSection, setFocusSection] = (0, import_react84.useState)("mode");
|
|
338180
338192
|
useKeypress(
|
|
338181
338193
|
(key) => {
|
|
338182
338194
|
if (key.name === "tab") {
|
|
@@ -338677,7 +338689,7 @@ var DialogManager = /* @__PURE__ */ __name(({
|
|
|
338677
338689
|
|
|
338678
338690
|
// packages/cli/src/ui/components/Composer.tsx
|
|
338679
338691
|
init_esbuild_shims();
|
|
338680
|
-
var
|
|
338692
|
+
var import_react98 = __toESM(require_react(), 1);
|
|
338681
338693
|
|
|
338682
338694
|
// packages/cli/src/ui/components/LoadingIndicator.tsx
|
|
338683
338695
|
init_esbuild_shims();
|
|
@@ -338923,14 +338935,14 @@ var DetailedMessagesDisplay = /* @__PURE__ */ __name(({ messages, maxHeight, wid
|
|
|
338923
338935
|
|
|
338924
338936
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
338925
338937
|
init_esbuild_shims();
|
|
338926
|
-
var
|
|
338938
|
+
var import_react94 = __toESM(require_react(), 1);
|
|
338927
338939
|
|
|
338928
338940
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
338929
338941
|
init_esbuild_shims();
|
|
338930
338942
|
|
|
338931
338943
|
// packages/cli/src/ui/components/PrepareLabel.tsx
|
|
338932
338944
|
init_esbuild_shims();
|
|
338933
|
-
var
|
|
338945
|
+
var import_react85 = __toESM(require_react(), 1);
|
|
338934
338946
|
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
|
|
338935
338947
|
var MAX_WIDTH = 150;
|
|
338936
338948
|
var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
@@ -338996,7 +339008,7 @@ var _PrepareLabel = /* @__PURE__ */ __name(({
|
|
|
338996
339008
|
after
|
|
338997
339009
|
] });
|
|
338998
339010
|
}, "_PrepareLabel");
|
|
338999
|
-
var PrepareLabel =
|
|
339011
|
+
var PrepareLabel = import_react85.default.memo(_PrepareLabel);
|
|
339000
339012
|
|
|
339001
339013
|
// packages/cli/src/ui/components/SuggestionsDisplay.tsx
|
|
339002
339014
|
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -339075,7 +339087,7 @@ __name(SuggestionsDisplay, "SuggestionsDisplay");
|
|
|
339075
339087
|
|
|
339076
339088
|
// packages/cli/src/ui/hooks/useInputHistory.ts
|
|
339077
339089
|
init_esbuild_shims();
|
|
339078
|
-
var
|
|
339090
|
+
var import_react86 = __toESM(require_react(), 1);
|
|
339079
339091
|
function useInputHistory({
|
|
339080
339092
|
userMessages,
|
|
339081
339093
|
onSubmit,
|
|
@@ -339083,13 +339095,13 @@ function useInputHistory({
|
|
|
339083
339095
|
currentQuery,
|
|
339084
339096
|
onChange
|
|
339085
339097
|
}) {
|
|
339086
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
339087
|
-
const [originalQueryBeforeNav, setOriginalQueryBeforeNav] = (0,
|
|
339088
|
-
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)(() => {
|
|
339089
339101
|
setHistoryIndex(-1);
|
|
339090
339102
|
setOriginalQueryBeforeNav("");
|
|
339091
339103
|
}, []);
|
|
339092
|
-
const handleSubmit = (0,
|
|
339104
|
+
const handleSubmit = (0, import_react86.useCallback)(
|
|
339093
339105
|
(value) => {
|
|
339094
339106
|
const trimmedValue = value.trim();
|
|
339095
339107
|
if (trimmedValue) {
|
|
@@ -339099,7 +339111,7 @@ function useInputHistory({
|
|
|
339099
339111
|
},
|
|
339100
339112
|
[onSubmit, resetHistoryNav]
|
|
339101
339113
|
);
|
|
339102
|
-
const navigateUp = (0,
|
|
339114
|
+
const navigateUp = (0, import_react86.useCallback)(() => {
|
|
339103
339115
|
if (!isActive) return false;
|
|
339104
339116
|
if (userMessages.length === 0) return false;
|
|
339105
339117
|
let nextIndex = historyIndex;
|
|
@@ -339128,7 +339140,7 @@ function useInputHistory({
|
|
|
339128
339140
|
// Use currentQuery from props
|
|
339129
339141
|
setOriginalQueryBeforeNav
|
|
339130
339142
|
]);
|
|
339131
|
-
const navigateDown = (0,
|
|
339143
|
+
const navigateDown = (0, import_react86.useCallback)(() => {
|
|
339132
339144
|
if (!isActive) return false;
|
|
339133
339145
|
if (historyIndex === -1) return false;
|
|
339134
339146
|
const nextIndex = historyIndex - 1;
|
|
@@ -339161,7 +339173,7 @@ var import_chalk7 = __toESM(require_source(), 1);
|
|
|
339161
339173
|
|
|
339162
339174
|
// packages/cli/src/ui/hooks/useShellHistory.ts
|
|
339163
339175
|
init_esbuild_shims();
|
|
339164
|
-
var
|
|
339176
|
+
var import_react87 = __toESM(require_react(), 1);
|
|
339165
339177
|
init_core2();
|
|
339166
339178
|
import * as fs75 from "node:fs/promises";
|
|
339167
339179
|
import * as path77 from "node:path";
|
|
@@ -339206,10 +339218,10 @@ async function writeHistoryFile(filePath, history) {
|
|
|
339206
339218
|
}
|
|
339207
339219
|
__name(writeHistoryFile, "writeHistoryFile");
|
|
339208
339220
|
function useShellHistory(projectRoot, storage) {
|
|
339209
|
-
const [history, setHistory] = (0,
|
|
339210
|
-
const [historyIndex, setHistoryIndex] = (0,
|
|
339211
|
-
const [historyFilePath, setHistoryFilePath] = (0,
|
|
339212
|
-
(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)(() => {
|
|
339213
339225
|
async function loadHistory() {
|
|
339214
339226
|
const filePath = await getHistoryFilePath(projectRoot, storage);
|
|
339215
339227
|
setHistoryFilePath(filePath);
|
|
@@ -339219,7 +339231,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339219
339231
|
__name(loadHistory, "loadHistory");
|
|
339220
339232
|
loadHistory();
|
|
339221
339233
|
}, [projectRoot, storage]);
|
|
339222
|
-
const addCommandToHistory = (0,
|
|
339234
|
+
const addCommandToHistory = (0, import_react87.useCallback)(
|
|
339223
339235
|
(command2) => {
|
|
339224
339236
|
if (!command2.trim() || !historyFilePath) {
|
|
339225
339237
|
return;
|
|
@@ -339231,7 +339243,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339231
339243
|
},
|
|
339232
339244
|
[history, historyFilePath]
|
|
339233
339245
|
);
|
|
339234
|
-
const getPreviousCommand = (0,
|
|
339246
|
+
const getPreviousCommand = (0, import_react87.useCallback)(() => {
|
|
339235
339247
|
if (history.length === 0) {
|
|
339236
339248
|
return null;
|
|
339237
339249
|
}
|
|
@@ -339239,7 +339251,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339239
339251
|
setHistoryIndex(newIndex);
|
|
339240
339252
|
return history[newIndex] ?? null;
|
|
339241
339253
|
}, [history, historyIndex]);
|
|
339242
|
-
const getNextCommand = (0,
|
|
339254
|
+
const getNextCommand = (0, import_react87.useCallback)(() => {
|
|
339243
339255
|
if (historyIndex < 0) {
|
|
339244
339256
|
return null;
|
|
339245
339257
|
}
|
|
@@ -339250,7 +339262,7 @@ function useShellHistory(projectRoot, storage) {
|
|
|
339250
339262
|
}
|
|
339251
339263
|
return history[newIndex] ?? null;
|
|
339252
339264
|
}, [history, historyIndex]);
|
|
339253
|
-
const resetHistoryPosition = (0,
|
|
339265
|
+
const resetHistoryPosition = (0, import_react87.useCallback)(() => {
|
|
339254
339266
|
setHistoryIndex(-1);
|
|
339255
339267
|
}, []);
|
|
339256
339268
|
return {
|
|
@@ -339265,19 +339277,19 @@ __name(useShellHistory, "useShellHistory");
|
|
|
339265
339277
|
|
|
339266
339278
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
339267
339279
|
init_esbuild_shims();
|
|
339268
|
-
var
|
|
339280
|
+
var import_react89 = __toESM(require_react(), 1);
|
|
339269
339281
|
|
|
339270
339282
|
// packages/cli/src/ui/hooks/useCompletion.ts
|
|
339271
339283
|
init_esbuild_shims();
|
|
339272
|
-
var
|
|
339284
|
+
var import_react88 = __toESM(require_react(), 1);
|
|
339273
339285
|
function useCompletion() {
|
|
339274
|
-
const [suggestions, setSuggestions] = (0,
|
|
339275
|
-
const [activeSuggestionIndex, setActiveSuggestionIndex] = (0,
|
|
339276
|
-
const [visibleStartIndex, setVisibleStartIndex] = (0,
|
|
339277
|
-
const [showSuggestions, setShowSuggestions] = (0,
|
|
339278
|
-
const [isLoadingSuggestions, setIsLoadingSuggestions] = (0,
|
|
339279
|
-
const [isPerfectMatch, setIsPerfectMatch] = (0,
|
|
339280
|
-
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)(() => {
|
|
339281
339293
|
setSuggestions([]);
|
|
339282
339294
|
setActiveSuggestionIndex(-1);
|
|
339283
339295
|
setVisibleStartIndex(0);
|
|
@@ -339285,7 +339297,7 @@ function useCompletion() {
|
|
|
339285
339297
|
setIsLoadingSuggestions(false);
|
|
339286
339298
|
setIsPerfectMatch(false);
|
|
339287
339299
|
}, []);
|
|
339288
|
-
const navigateUp = (0,
|
|
339300
|
+
const navigateUp = (0, import_react88.useCallback)(() => {
|
|
339289
339301
|
if (suggestions.length === 0) return;
|
|
339290
339302
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
339291
339303
|
const newActiveIndex = prevActiveIndex <= 0 ? suggestions.length - 1 : prevActiveIndex - 1;
|
|
@@ -339301,7 +339313,7 @@ function useCompletion() {
|
|
|
339301
339313
|
return newActiveIndex;
|
|
339302
339314
|
});
|
|
339303
339315
|
}, [suggestions.length]);
|
|
339304
|
-
const navigateDown = (0,
|
|
339316
|
+
const navigateDown = (0, import_react88.useCallback)(() => {
|
|
339305
339317
|
if (suggestions.length === 0) return;
|
|
339306
339318
|
setActiveSuggestionIndex((prevActiveIndex) => {
|
|
339307
339319
|
const newActiveIndex = prevActiveIndex >= suggestions.length - 1 ? 0 : prevActiveIndex + 1;
|
|
@@ -339340,8 +339352,8 @@ __name(useCompletion, "useCompletion");
|
|
|
339340
339352
|
|
|
339341
339353
|
// packages/cli/src/ui/hooks/useReverseSearchCompletion.tsx
|
|
339342
339354
|
function useDebouncedValue(value, delay4 = 200) {
|
|
339343
|
-
const [debounced, setDebounced] = (0,
|
|
339344
|
-
(0,
|
|
339355
|
+
const [debounced, setDebounced] = (0, import_react89.useState)(value);
|
|
339356
|
+
(0, import_react89.useEffect)(() => {
|
|
339345
339357
|
const handle = setTimeout(() => setDebounced(value), delay4);
|
|
339346
339358
|
return () => clearTimeout(handle);
|
|
339347
339359
|
}, [value, delay4]);
|
|
@@ -339364,19 +339376,19 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339364
339376
|
setVisibleStartIndex
|
|
339365
339377
|
} = useCompletion();
|
|
339366
339378
|
const debouncedQuery = useDebouncedValue(buffer.text, 100);
|
|
339367
|
-
const prevQueryRef = (0,
|
|
339368
|
-
const prevMatchesRef = (0,
|
|
339369
|
-
(0,
|
|
339379
|
+
const prevQueryRef = (0, import_react89.useRef)("");
|
|
339380
|
+
const prevMatchesRef = (0, import_react89.useRef)([]);
|
|
339381
|
+
(0, import_react89.useEffect)(() => {
|
|
339370
339382
|
if (reverseSearchActive) {
|
|
339371
339383
|
prevQueryRef.current = "";
|
|
339372
339384
|
prevMatchesRef.current = [];
|
|
339373
339385
|
}
|
|
339374
339386
|
}, [reverseSearchActive]);
|
|
339375
|
-
(0,
|
|
339387
|
+
(0, import_react89.useEffect)(() => {
|
|
339376
339388
|
prevQueryRef.current = "";
|
|
339377
339389
|
prevMatchesRef.current = [];
|
|
339378
339390
|
}, [history]);
|
|
339379
|
-
const searchHistory = (0,
|
|
339391
|
+
const searchHistory = (0, import_react89.useCallback)(
|
|
339380
339392
|
(query, items) => {
|
|
339381
339393
|
const out = [];
|
|
339382
339394
|
for (let i = 0; i < items.length; i++) {
|
|
@@ -339390,7 +339402,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339390
339402
|
},
|
|
339391
339403
|
[]
|
|
339392
339404
|
);
|
|
339393
|
-
const matches = (0,
|
|
339405
|
+
const matches = (0, import_react89.useMemo)(() => {
|
|
339394
339406
|
if (!reverseSearchActive) return [];
|
|
339395
339407
|
if (debouncedQuery.length === 0)
|
|
339396
339408
|
return history.map((cmd) => ({
|
|
@@ -339403,7 +339415,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339403
339415
|
const source2 = canUseCache ? prevMatchesRef.current.map((m) => m.value) : history;
|
|
339404
339416
|
return searchHistory(query, source2);
|
|
339405
339417
|
}, [debouncedQuery, history, reverseSearchActive, searchHistory]);
|
|
339406
|
-
(0,
|
|
339418
|
+
(0, import_react89.useEffect)(() => {
|
|
339407
339419
|
if (!reverseSearchActive) {
|
|
339408
339420
|
resetCompletionState();
|
|
339409
339421
|
return;
|
|
@@ -339425,7 +339437,7 @@ function useReverseSearchCompletion(buffer, history, reverseSearchActive) {
|
|
|
339425
339437
|
setVisibleStartIndex,
|
|
339426
339438
|
resetCompletionState
|
|
339427
339439
|
]);
|
|
339428
|
-
const handleAutocomplete = (0,
|
|
339440
|
+
const handleAutocomplete = (0, import_react89.useCallback)(
|
|
339429
339441
|
(i) => {
|
|
339430
339442
|
if (i < 0 || i >= suggestions.length) return;
|
|
339431
339443
|
buffer.setText(suggestions[i].value);
|
|
@@ -339449,11 +339461,11 @@ __name(useReverseSearchCompletion, "useReverseSearchCompletion");
|
|
|
339449
339461
|
|
|
339450
339462
|
// packages/cli/src/ui/hooks/useCommandCompletion.tsx
|
|
339451
339463
|
init_esbuild_shims();
|
|
339452
|
-
var
|
|
339464
|
+
var import_react92 = __toESM(require_react(), 1);
|
|
339453
339465
|
|
|
339454
339466
|
// packages/cli/src/ui/hooks/useAtCompletion.ts
|
|
339455
339467
|
init_esbuild_shims();
|
|
339456
|
-
var
|
|
339468
|
+
var import_react90 = __toESM(require_react(), 1);
|
|
339457
339469
|
init_core2();
|
|
339458
339470
|
var initialState = {
|
|
339459
339471
|
status: "idle" /* IDLE */,
|
|
@@ -339512,20 +339524,20 @@ function useAtCompletion(props) {
|
|
|
339512
339524
|
setSuggestions,
|
|
339513
339525
|
setIsLoadingSuggestions
|
|
339514
339526
|
} = props;
|
|
339515
|
-
const [state, dispatch] = (0,
|
|
339516
|
-
const fileSearch = (0,
|
|
339517
|
-
const searchAbortController = (0,
|
|
339518
|
-
const slowSearchTimer = (0,
|
|
339519
|
-
(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)(() => {
|
|
339520
339532
|
setSuggestions(state.suggestions);
|
|
339521
339533
|
}, [state.suggestions, setSuggestions]);
|
|
339522
|
-
(0,
|
|
339534
|
+
(0, import_react90.useEffect)(() => {
|
|
339523
339535
|
setIsLoadingSuggestions(state.isLoading);
|
|
339524
339536
|
}, [state.isLoading, setIsLoadingSuggestions]);
|
|
339525
|
-
(0,
|
|
339537
|
+
(0, import_react90.useEffect)(() => {
|
|
339526
339538
|
dispatch({ type: "RESET" });
|
|
339527
339539
|
}, [cwd7, config]);
|
|
339528
|
-
(0,
|
|
339540
|
+
(0, import_react90.useEffect)(() => {
|
|
339529
339541
|
if (!enabled) {
|
|
339530
339542
|
if (state.status === "ready" /* READY */ || state.status === "error" /* ERROR */) {
|
|
339531
339543
|
dispatch({ type: "RESET" });
|
|
@@ -339542,7 +339554,7 @@ function useAtCompletion(props) {
|
|
|
339542
339554
|
dispatch({ type: "SEARCH", payload: pattern });
|
|
339543
339555
|
}
|
|
339544
339556
|
}, [enabled, pattern, state.status, state.pattern]);
|
|
339545
|
-
(0,
|
|
339557
|
+
(0, import_react90.useEffect)(() => {
|
|
339546
339558
|
const initialize = /* @__PURE__ */ __name(async () => {
|
|
339547
339559
|
try {
|
|
339548
339560
|
const searcher = FileSearchFactory.create({
|
|
@@ -339617,7 +339629,7 @@ __name(useAtCompletion, "useAtCompletion");
|
|
|
339617
339629
|
|
|
339618
339630
|
// packages/cli/src/ui/hooks/useSlashCompletion.ts
|
|
339619
339631
|
init_esbuild_shims();
|
|
339620
|
-
var
|
|
339632
|
+
var import_react91 = __toESM(require_react(), 1);
|
|
339621
339633
|
init_fzf_es();
|
|
339622
339634
|
function logErrorSafely(error, context2) {
|
|
339623
339635
|
if (error instanceof Error) {
|
|
@@ -339632,7 +339644,7 @@ function matchesCommand(cmd, query) {
|
|
|
339632
339644
|
}
|
|
339633
339645
|
__name(matchesCommand, "matchesCommand");
|
|
339634
339646
|
function useCommandParser(query, slashCommands) {
|
|
339635
|
-
return (0,
|
|
339647
|
+
return (0, import_react91.useMemo)(() => {
|
|
339636
339648
|
if (!query) {
|
|
339637
339649
|
return {
|
|
339638
339650
|
hasTrailingSpace: false,
|
|
@@ -339702,9 +339714,9 @@ function useCommandParser(query, slashCommands) {
|
|
|
339702
339714
|
}
|
|
339703
339715
|
__name(useCommandParser, "useCommandParser");
|
|
339704
339716
|
function useCommandSuggestions(parserResult, commandContext, getFzfForCommands, getPrefixSuggestions) {
|
|
339705
|
-
const [suggestions, setSuggestions] = (0,
|
|
339706
|
-
const [isLoading, setIsLoading] = (0,
|
|
339707
|
-
(0,
|
|
339717
|
+
const [suggestions, setSuggestions] = (0, import_react91.useState)([]);
|
|
339718
|
+
const [isLoading, setIsLoading] = (0, import_react91.useState)(false);
|
|
339719
|
+
(0, import_react91.useEffect)(() => {
|
|
339708
339720
|
const abortController = new AbortController();
|
|
339709
339721
|
const { signal } = abortController;
|
|
339710
339722
|
const {
|
|
@@ -339824,7 +339836,7 @@ function useCommandSuggestions(parserResult, commandContext, getFzfForCommands,
|
|
|
339824
339836
|
}
|
|
339825
339837
|
__name(useCommandSuggestions, "useCommandSuggestions");
|
|
339826
339838
|
function useCompletionPositions(query, parserResult) {
|
|
339827
|
-
return (0,
|
|
339839
|
+
return (0, import_react91.useMemo)(() => {
|
|
339828
339840
|
if (!query) {
|
|
339829
339841
|
return { start: -1, end: -1 };
|
|
339830
339842
|
}
|
|
@@ -339846,7 +339858,7 @@ function useCompletionPositions(query, parserResult) {
|
|
|
339846
339858
|
}
|
|
339847
339859
|
__name(useCompletionPositions, "useCompletionPositions");
|
|
339848
339860
|
function usePerfectMatch(parserResult) {
|
|
339849
|
-
return (0,
|
|
339861
|
+
return (0, import_react91.useMemo)(() => {
|
|
339850
339862
|
const { hasTrailingSpace, partial, leafCommand, currentLevel } = parserResult;
|
|
339851
339863
|
if (hasTrailingSpace) {
|
|
339852
339864
|
return { isPerfectMatch: false };
|
|
@@ -339876,13 +339888,13 @@ function useSlashCompletion(props) {
|
|
|
339876
339888
|
setIsLoadingSuggestions,
|
|
339877
339889
|
setIsPerfectMatch
|
|
339878
339890
|
} = props;
|
|
339879
|
-
const [completionStart, setCompletionStart] = (0,
|
|
339880
|
-
const [completionEnd, setCompletionEnd] = (0,
|
|
339881
|
-
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)(
|
|
339882
339894
|
() => /* @__PURE__ */ new WeakMap(),
|
|
339883
339895
|
[]
|
|
339884
339896
|
);
|
|
339885
|
-
const getFzfForCommands = (0,
|
|
339897
|
+
const getFzfForCommands = (0, import_react91.useMemo)(
|
|
339886
339898
|
() => (commands) => {
|
|
339887
339899
|
if (!commands || commands.length === 0) {
|
|
339888
339900
|
return null;
|
|
@@ -339926,7 +339938,7 @@ function useSlashCompletion(props) {
|
|
|
339926
339938
|
},
|
|
339927
339939
|
[fzfInstanceCache]
|
|
339928
339940
|
);
|
|
339929
|
-
const getPrefixSuggestions = (0,
|
|
339941
|
+
const getPrefixSuggestions = (0, import_react91.useMemo)(
|
|
339930
339942
|
() => (commands, partial) => commands.filter(
|
|
339931
339943
|
(cmd) => cmd.description && !cmd.hidden && (cmd.name.toLowerCase().startsWith(partial.toLowerCase()) || cmd.altNames?.some(
|
|
339932
339944
|
(alt) => alt.toLowerCase().startsWith(partial.toLowerCase())
|
|
@@ -339946,7 +339958,7 @@ function useSlashCompletion(props) {
|
|
|
339946
339958
|
parserResult
|
|
339947
339959
|
);
|
|
339948
339960
|
const { isPerfectMatch } = usePerfectMatch(parserResult);
|
|
339949
|
-
(0,
|
|
339961
|
+
(0, import_react91.useEffect)(() => {
|
|
339950
339962
|
if (!enabled) {
|
|
339951
339963
|
setSuggestions([]);
|
|
339952
339964
|
setIsLoadingSuggestions(false);
|
|
@@ -339955,7 +339967,7 @@ function useSlashCompletion(props) {
|
|
|
339955
339967
|
setCompletionEnd(-1);
|
|
339956
339968
|
}
|
|
339957
339969
|
}, [enabled, setSuggestions, setIsLoadingSuggestions, setIsPerfectMatch]);
|
|
339958
|
-
(0,
|
|
339970
|
+
(0, import_react91.useEffect)(() => {
|
|
339959
339971
|
if (!enabled || query === null) {
|
|
339960
339972
|
return;
|
|
339961
339973
|
}
|
|
@@ -340004,7 +340016,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
340004
340016
|
} = useCompletion();
|
|
340005
340017
|
const cursorRow = buffer.cursor[0];
|
|
340006
340018
|
const cursorCol = buffer.cursor[1];
|
|
340007
|
-
const { completionMode, query, completionStart, completionEnd } = (0,
|
|
340019
|
+
const { completionMode, query, completionStart, completionEnd } = (0, import_react92.useMemo)(() => {
|
|
340008
340020
|
const currentLine = buffer.lines[cursorRow] || "";
|
|
340009
340021
|
if (cursorRow === 0 && isSlashCommand(currentLine.trim())) {
|
|
340010
340022
|
return {
|
|
@@ -340073,11 +340085,11 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
340073
340085
|
setIsLoadingSuggestions,
|
|
340074
340086
|
setIsPerfectMatch
|
|
340075
340087
|
});
|
|
340076
|
-
(0,
|
|
340088
|
+
(0, import_react92.useEffect)(() => {
|
|
340077
340089
|
setActiveSuggestionIndex(suggestions.length > 0 ? 0 : -1);
|
|
340078
340090
|
setVisibleStartIndex(0);
|
|
340079
340091
|
}, [suggestions, setActiveSuggestionIndex, setVisibleStartIndex]);
|
|
340080
|
-
(0,
|
|
340092
|
+
(0, import_react92.useEffect)(() => {
|
|
340081
340093
|
if (completionMode === "IDLE" /* IDLE */ || reverseSearchActive) {
|
|
340082
340094
|
resetCompletionState();
|
|
340083
340095
|
return;
|
|
@@ -340091,7 +340103,7 @@ function useCommandCompletion(buffer, dirs, cwd7, slashCommands, commandContext,
|
|
|
340091
340103
|
resetCompletionState,
|
|
340092
340104
|
setShowSuggestions
|
|
340093
340105
|
]);
|
|
340094
|
-
const handleAutocomplete = (0,
|
|
340106
|
+
const handleAutocomplete = (0, import_react92.useCallback)(
|
|
340095
340107
|
(indexToUse) => {
|
|
340096
340108
|
if (indexToUse < 0 || indexToUse >= suggestions.length) {
|
|
340097
340109
|
return;
|
|
@@ -340321,9 +340333,9 @@ import * as path79 from "node:path";
|
|
|
340321
340333
|
|
|
340322
340334
|
// packages/cli/src/ui/contexts/ShellFocusContext.tsx
|
|
340323
340335
|
init_esbuild_shims();
|
|
340324
|
-
var
|
|
340325
|
-
var ShellFocusContext = (0,
|
|
340326
|
-
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");
|
|
340327
340339
|
|
|
340328
340340
|
// packages/cli/src/ui/components/InputPrompt.tsx
|
|
340329
340341
|
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
|
|
@@ -340363,29 +340375,29 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340363
340375
|
isEmbeddedShellFocused
|
|
340364
340376
|
}) => {
|
|
340365
340377
|
const isShellFocused = useShellFocusState();
|
|
340366
|
-
const [justNavigatedHistory, setJustNavigatedHistory] = (0,
|
|
340367
|
-
const [escPressCount, setEscPressCount] = (0,
|
|
340368
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
340369
|
-
const escapeTimerRef = (0,
|
|
340370
|
-
const [recentPasteTime, setRecentPasteTime] = (0,
|
|
340371
|
-
const pasteTimeoutRef = (0,
|
|
340372
|
-
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)(
|
|
340373
340385
|
config.getWorkspaceContext().getDirectories()
|
|
340374
340386
|
);
|
|
340375
340387
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
340376
|
-
(0,
|
|
340388
|
+
(0, import_react94.useEffect)(() => {
|
|
340377
340389
|
if (dirs.length !== dirsChanged.length) {
|
|
340378
340390
|
setDirs(dirsChanged);
|
|
340379
340391
|
}
|
|
340380
340392
|
}, [dirs.length, dirsChanged]);
|
|
340381
|
-
const [reverseSearchActive, setReverseSearchActive] = (0,
|
|
340382
|
-
const [commandSearchActive, setCommandSearchActive] = (0,
|
|
340383
|
-
const [textBeforeReverseSearch, setTextBeforeReverseSearch] = (0,
|
|
340384
|
-
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)([
|
|
340385
340397
|
0,
|
|
340386
340398
|
0
|
|
340387
340399
|
]);
|
|
340388
|
-
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0,
|
|
340400
|
+
const [expandedSuggestionIndex, setExpandedSuggestionIndex] = (0, import_react94.useState)(-1);
|
|
340389
340401
|
const shellHistory = useShellHistory(config.getProjectRoot());
|
|
340390
340402
|
const shellHistoryData = shellHistory.history;
|
|
340391
340403
|
const completion3 = useCommandCompletion(
|
|
@@ -340411,7 +340423,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340411
340423
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
340412
340424
|
const resetCommandSearchCompletionState = commandSearchCompletion.resetCompletionState;
|
|
340413
340425
|
const showCursor = focus && isShellFocused && !isEmbeddedShellFocused;
|
|
340414
|
-
const resetEscapeState = (0,
|
|
340426
|
+
const resetEscapeState = (0, import_react94.useCallback)(() => {
|
|
340415
340427
|
if (escapeTimerRef.current) {
|
|
340416
340428
|
clearTimeout(escapeTimerRef.current);
|
|
340417
340429
|
escapeTimerRef.current = null;
|
|
@@ -340419,12 +340431,12 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340419
340431
|
setEscPressCount(0);
|
|
340420
340432
|
setShowEscapePrompt(false);
|
|
340421
340433
|
}, []);
|
|
340422
|
-
(0,
|
|
340434
|
+
(0, import_react94.useEffect)(() => {
|
|
340423
340435
|
if (onEscapePromptChange) {
|
|
340424
340436
|
onEscapePromptChange(showEscapePrompt);
|
|
340425
340437
|
}
|
|
340426
340438
|
}, [showEscapePrompt, onEscapePromptChange]);
|
|
340427
|
-
(0,
|
|
340439
|
+
(0, import_react94.useEffect)(
|
|
340428
340440
|
() => () => {
|
|
340429
340441
|
if (escapeTimerRef.current) {
|
|
340430
340442
|
clearTimeout(escapeTimerRef.current);
|
|
@@ -340435,7 +340447,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340435
340447
|
},
|
|
340436
340448
|
[]
|
|
340437
340449
|
);
|
|
340438
|
-
const handleSubmitAndClear = (0,
|
|
340450
|
+
const handleSubmitAndClear = (0, import_react94.useCallback)(
|
|
340439
340451
|
(submittedValue) => {
|
|
340440
340452
|
if (shellModeActive) {
|
|
340441
340453
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -340454,7 +340466,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340454
340466
|
resetReverseSearchCompletionState
|
|
340455
340467
|
]
|
|
340456
340468
|
);
|
|
340457
|
-
const customSetTextAndResetCompletionSignal = (0,
|
|
340469
|
+
const customSetTextAndResetCompletionSignal = (0, import_react94.useCallback)(
|
|
340458
340470
|
(newText) => {
|
|
340459
340471
|
buffer.setText(newText);
|
|
340460
340472
|
setJustNavigatedHistory(true);
|
|
@@ -340468,7 +340480,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340468
340480
|
currentQuery: buffer.text,
|
|
340469
340481
|
onChange: customSetTextAndResetCompletionSignal
|
|
340470
340482
|
});
|
|
340471
|
-
(0,
|
|
340483
|
+
(0, import_react94.useEffect)(() => {
|
|
340472
340484
|
if (justNavigatedHistory) {
|
|
340473
340485
|
resetCompletionState();
|
|
340474
340486
|
resetReverseSearchCompletionState();
|
|
@@ -340484,7 +340496,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340484
340496
|
resetReverseSearchCompletionState,
|
|
340485
340497
|
resetCommandSearchCompletionState
|
|
340486
340498
|
]);
|
|
340487
|
-
const handleClipboardImage = (0,
|
|
340499
|
+
const handleClipboardImage = (0, import_react94.useCallback)(async () => {
|
|
340488
340500
|
try {
|
|
340489
340501
|
if (await clipboardHasImage()) {
|
|
340490
340502
|
const imagePath = await saveClipboardImage(config.getTargetDir());
|
|
@@ -340516,7 +340528,7 @@ var InputPrompt = /* @__PURE__ */ __name(({
|
|
|
340516
340528
|
console.error("Error handling clipboard image:", error);
|
|
340517
340529
|
}
|
|
340518
340530
|
}, [buffer, config]);
|
|
340519
|
-
const handleInput = (0,
|
|
340531
|
+
const handleInput = (0, import_react94.useCallback)(
|
|
340520
340532
|
(key) => {
|
|
340521
340533
|
if (!focus && !key.paste) {
|
|
340522
340534
|
return;
|
|
@@ -340973,15 +340985,15 @@ import process31 from "node:process";
|
|
|
340973
340985
|
|
|
340974
340986
|
// packages/cli/src/ui/components/MemoryUsageDisplay.tsx
|
|
340975
340987
|
init_esbuild_shims();
|
|
340976
|
-
var
|
|
340988
|
+
var import_react95 = __toESM(require_react(), 1);
|
|
340977
340989
|
import process30 from "node:process";
|
|
340978
340990
|
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
|
|
340979
340991
|
var MemoryUsageDisplay = /* @__PURE__ */ __name(() => {
|
|
340980
|
-
const [memoryUsage, setMemoryUsage] = (0,
|
|
340981
|
-
const [memoryUsageColor, setMemoryUsageColor] = (0,
|
|
340992
|
+
const [memoryUsage, setMemoryUsage] = (0, import_react95.useState)("");
|
|
340993
|
+
const [memoryUsageColor, setMemoryUsageColor] = (0, import_react95.useState)(
|
|
340982
340994
|
theme.text.secondary
|
|
340983
340995
|
);
|
|
340984
|
-
(0,
|
|
340996
|
+
(0, import_react95.useEffect)(() => {
|
|
340985
340997
|
const updateMemory = /* @__PURE__ */ __name(() => {
|
|
340986
340998
|
const usage2 = process30.memoryUsage().rss;
|
|
340987
340999
|
setMemoryUsage(formatMemoryUsage2(usage2));
|
|
@@ -341021,12 +341033,12 @@ var ContextUsageDisplay = /* @__PURE__ */ __name(({
|
|
|
341021
341033
|
|
|
341022
341034
|
// packages/cli/src/ui/components/DebugProfiler.tsx
|
|
341023
341035
|
init_esbuild_shims();
|
|
341024
|
-
var
|
|
341036
|
+
var import_react96 = __toESM(require_react(), 1);
|
|
341025
341037
|
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
|
|
341026
341038
|
var DebugProfiler = /* @__PURE__ */ __name(() => {
|
|
341027
|
-
const numRenders = (0,
|
|
341028
|
-
const [showNumRenders, setShowNumRenders] = (0,
|
|
341029
|
-
(0,
|
|
341039
|
+
const numRenders = (0, import_react96.useRef)(0);
|
|
341040
|
+
const [showNumRenders, setShowNumRenders] = (0, import_react96.useState)(false);
|
|
341041
|
+
(0, import_react96.useEffect)(() => {
|
|
341030
341042
|
numRenders.current++;
|
|
341031
341043
|
});
|
|
341032
341044
|
useKeypress(
|
|
@@ -341205,7 +341217,7 @@ init_core2();
|
|
|
341205
341217
|
|
|
341206
341218
|
// packages/cli/src/ui/components/ConfigInitDisplay.tsx
|
|
341207
341219
|
init_esbuild_shims();
|
|
341208
|
-
var
|
|
341220
|
+
var import_react97 = __toESM(require_react(), 1);
|
|
341209
341221
|
|
|
341210
341222
|
// packages/cli/src/utils/events.ts
|
|
341211
341223
|
init_esbuild_shims();
|
|
@@ -341217,8 +341229,8 @@ init_core2();
|
|
|
341217
341229
|
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
|
|
341218
341230
|
var ConfigInitDisplay = /* @__PURE__ */ __name(() => {
|
|
341219
341231
|
const config = useConfig();
|
|
341220
|
-
const [message, setMessage] = (0,
|
|
341221
|
-
(0,
|
|
341232
|
+
const [message, setMessage] = (0, import_react97.useState)("Initializing...");
|
|
341233
|
+
(0, import_react97.useEffect)(() => {
|
|
341222
341234
|
const onChange = /* @__PURE__ */ __name((clients) => {
|
|
341223
341235
|
if (!clients || clients.size === 0) {
|
|
341224
341236
|
setMessage(`Initializing...`);
|
|
@@ -341257,7 +341269,7 @@ var Composer = /* @__PURE__ */ __name(() => {
|
|
|
341257
341269
|
const isNarrow = isNarrowWidth(terminalWidth);
|
|
341258
341270
|
const debugConsoleMaxHeight = Math.floor(Math.max(terminalWidth * 0.2, 5));
|
|
341259
341271
|
const { contextFileNames, showAutoAcceptIndicator } = uiState;
|
|
341260
|
-
const { containerWidth } = (0,
|
|
341272
|
+
const { containerWidth } = (0, import_react98.useMemo)(
|
|
341261
341273
|
() => calculatePromptWidths(uiState.terminalWidth),
|
|
341262
341274
|
[uiState.terminalWidth]
|
|
341263
341275
|
);
|
|
@@ -347370,7 +347382,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
347370
347382
|
// packages/cli/src/utils/version.ts
|
|
347371
347383
|
async function getCliVersion() {
|
|
347372
347384
|
const pkgJson = await getPackageJson();
|
|
347373
|
-
return "0.0.28-alpha.
|
|
347385
|
+
return "0.0.28-alpha.9";
|
|
347374
347386
|
}
|
|
347375
347387
|
__name(getCliVersion, "getCliVersion");
|
|
347376
347388
|
|
|
@@ -348435,12 +348447,12 @@ import process50 from "node:process";
|
|
|
348435
348447
|
|
|
348436
348448
|
// packages/cli/src/ui/hooks/useMemoryMonitor.ts
|
|
348437
348449
|
init_esbuild_shims();
|
|
348438
|
-
var
|
|
348450
|
+
var import_react99 = __toESM(require_react(), 1);
|
|
348439
348451
|
import process33 from "node:process";
|
|
348440
348452
|
var MEMORY_WARNING_THRESHOLD = 7 * 1024 * 1024 * 1024;
|
|
348441
348453
|
var MEMORY_CHECK_INTERVAL = 60 * 1e3;
|
|
348442
348454
|
var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
348443
|
-
(0,
|
|
348455
|
+
(0, import_react99.useEffect)(() => {
|
|
348444
348456
|
const intervalId = setInterval(() => {
|
|
348445
348457
|
const usage2 = process33.memoryUsage().rss;
|
|
348446
348458
|
if (usage2 > MEMORY_WARNING_THRESHOLD) {
|
|
@@ -348460,11 +348472,11 @@ var useMemoryMonitor = /* @__PURE__ */ __name(({ addItem }) => {
|
|
|
348460
348472
|
|
|
348461
348473
|
// packages/cli/src/ui/hooks/useThemeCommand.ts
|
|
348462
348474
|
init_esbuild_shims();
|
|
348463
|
-
var
|
|
348475
|
+
var import_react100 = __toESM(require_react(), 1);
|
|
348464
348476
|
import process34 from "node:process";
|
|
348465
348477
|
var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, addItem, initialThemeError) => {
|
|
348466
|
-
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0,
|
|
348467
|
-
const openThemeDialog = (0,
|
|
348478
|
+
const [isThemeDialogOpen, setIsThemeDialogOpen] = (0, import_react100.useState)(!!initialThemeError);
|
|
348479
|
+
const openThemeDialog = (0, import_react100.useCallback)(() => {
|
|
348468
348480
|
if (process34.env["NO_COLOR"]) {
|
|
348469
348481
|
addItem(
|
|
348470
348482
|
{
|
|
@@ -348477,7 +348489,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348477
348489
|
}
|
|
348478
348490
|
setIsThemeDialogOpen(true);
|
|
348479
348491
|
}, [addItem]);
|
|
348480
|
-
const applyTheme = (0,
|
|
348492
|
+
const applyTheme = (0, import_react100.useCallback)(
|
|
348481
348493
|
(themeName) => {
|
|
348482
348494
|
if (!themeManager.setActiveTheme(themeName)) {
|
|
348483
348495
|
setIsThemeDialogOpen(true);
|
|
@@ -348488,13 +348500,13 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348488
348500
|
},
|
|
348489
348501
|
[setThemeError]
|
|
348490
348502
|
);
|
|
348491
|
-
const handleThemeHighlight = (0,
|
|
348503
|
+
const handleThemeHighlight = (0, import_react100.useCallback)(
|
|
348492
348504
|
(themeName) => {
|
|
348493
348505
|
applyTheme(themeName);
|
|
348494
348506
|
},
|
|
348495
348507
|
[applyTheme]
|
|
348496
348508
|
);
|
|
348497
|
-
const handleThemeSelect = (0,
|
|
348509
|
+
const handleThemeSelect = (0, import_react100.useCallback)(
|
|
348498
348510
|
(themeName, scope) => {
|
|
348499
348511
|
try {
|
|
348500
348512
|
const mergedCustomThemes = {
|
|
@@ -348531,7 +348543,7 @@ var useThemeCommand = /* @__PURE__ */ __name((loadedSettings, setThemeError, add
|
|
|
348531
348543
|
// packages/cli/src/ui/auth/useAuth.ts
|
|
348532
348544
|
init_esbuild_shims();
|
|
348533
348545
|
init_core2();
|
|
348534
|
-
var
|
|
348546
|
+
var import_react102 = __toESM(require_react(), 1);
|
|
348535
348547
|
init_xhsSsoConfig();
|
|
348536
348548
|
|
|
348537
348549
|
// packages/cli/src/ui/auth/performSsoAuthFlow.ts
|
|
@@ -348666,16 +348678,16 @@ __name(performSsoAuthFlow, "performSsoAuthFlow");
|
|
|
348666
348678
|
|
|
348667
348679
|
// packages/cli/src/ui/hooks/useQwenAuth.ts
|
|
348668
348680
|
init_esbuild_shims();
|
|
348669
|
-
var
|
|
348681
|
+
var import_react101 = __toESM(require_react(), 1);
|
|
348670
348682
|
init_core2();
|
|
348671
348683
|
var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
|
|
348672
|
-
const [qwenAuthState, setQwenAuthState] = (0,
|
|
348684
|
+
const [qwenAuthState, setQwenAuthState] = (0, import_react101.useState)({
|
|
348673
348685
|
deviceAuth: null,
|
|
348674
348686
|
authStatus: "idle",
|
|
348675
348687
|
authMessage: null
|
|
348676
348688
|
});
|
|
348677
348689
|
const isQwenAuth = pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */;
|
|
348678
|
-
(0,
|
|
348690
|
+
(0, import_react101.useEffect)(() => {
|
|
348679
348691
|
if (!isQwenAuth || !isAuthenticating) {
|
|
348680
348692
|
setQwenAuthState({
|
|
348681
348693
|
deviceAuth: null,
|
|
@@ -348715,7 +348727,7 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
348715
348727
|
qwenOAuth2Events.off("auth-progress" /* AuthProgress */, handleAuthProgress);
|
|
348716
348728
|
};
|
|
348717
348729
|
}, [isQwenAuth, isAuthenticating]);
|
|
348718
|
-
const cancelQwenAuth = (0,
|
|
348730
|
+
const cancelQwenAuth = (0, import_react101.useCallback)(() => {
|
|
348719
348731
|
qwenOAuth2Events.emit("auth-cancel" /* AuthCancel */);
|
|
348720
348732
|
setQwenAuthState({
|
|
348721
348733
|
deviceAuth: null,
|
|
@@ -348733,22 +348745,22 @@ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) =>
|
|
|
348733
348745
|
var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
348734
348746
|
const unAuthenticated = settings.merged.security?.auth?.selectedType === void 0;
|
|
348735
348747
|
const isSSOAutoAuthInProgress = shouldTriggerAutoSSOAuth(settings);
|
|
348736
|
-
const [authState, setAuthState] = (0,
|
|
348748
|
+
const [authState, setAuthState] = (0, import_react102.useState)(
|
|
348737
348749
|
unAuthenticated ? "updating" /* Updating */ : "unauthenticated" /* Unauthenticated */
|
|
348738
348750
|
);
|
|
348739
|
-
const [authError, setAuthError] = (0,
|
|
348740
|
-
const [isAuthenticating, setIsAuthenticating] = (0,
|
|
348741
|
-
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)(
|
|
348742
348754
|
unAuthenticated && !isSSOAutoAuthInProgress
|
|
348743
348755
|
);
|
|
348744
|
-
const [pendingAuthType, setPendingAuthType] = (0,
|
|
348756
|
+
const [pendingAuthType, setPendingAuthType] = (0, import_react102.useState)(
|
|
348745
348757
|
void 0
|
|
348746
348758
|
);
|
|
348747
348759
|
const { qwenAuthState, cancelQwenAuth } = useQwenAuth(
|
|
348748
348760
|
pendingAuthType,
|
|
348749
348761
|
isAuthenticating
|
|
348750
348762
|
);
|
|
348751
|
-
const onAuthError = (0,
|
|
348763
|
+
const onAuthError = (0, import_react102.useCallback)(
|
|
348752
348764
|
(error) => {
|
|
348753
348765
|
setAuthError(error);
|
|
348754
348766
|
if (error) {
|
|
@@ -348758,7 +348770,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348758
348770
|
},
|
|
348759
348771
|
[setAuthError, setAuthState]
|
|
348760
348772
|
);
|
|
348761
|
-
const handleAuthFailure = (0,
|
|
348773
|
+
const handleAuthFailure = (0, import_react102.useCallback)(
|
|
348762
348774
|
(error) => {
|
|
348763
348775
|
setIsAuthenticating(false);
|
|
348764
348776
|
setPendingAuthType(void 0);
|
|
@@ -348776,7 +348788,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348776
348788
|
},
|
|
348777
348789
|
[onAuthError, pendingAuthType, config]
|
|
348778
348790
|
);
|
|
348779
|
-
const handleAuthSuccess = (0,
|
|
348791
|
+
const handleAuthSuccess = (0, import_react102.useCallback)(
|
|
348780
348792
|
async (authType, scope, credentials) => {
|
|
348781
348793
|
try {
|
|
348782
348794
|
settings.setValue(scope, "security.auth.selectedType", authType);
|
|
@@ -348821,7 +348833,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348821
348833
|
},
|
|
348822
348834
|
[settings, handleAuthFailure, config, addItem]
|
|
348823
348835
|
);
|
|
348824
|
-
const performAuth = (0,
|
|
348836
|
+
const performAuth = (0, import_react102.useCallback)(
|
|
348825
348837
|
async (authType, scope, credentials) => {
|
|
348826
348838
|
try {
|
|
348827
348839
|
await config.refreshAuth(authType);
|
|
@@ -348832,7 +348844,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348832
348844
|
},
|
|
348833
348845
|
[config, handleAuthSuccess, handleAuthFailure]
|
|
348834
348846
|
);
|
|
348835
|
-
const handleAuthSelect = (0,
|
|
348847
|
+
const handleAuthSelect = (0, import_react102.useCallback)(
|
|
348836
348848
|
async (authType, scope, credentials) => {
|
|
348837
348849
|
if (!authType) {
|
|
348838
348850
|
setIsAuthDialogOpen(false);
|
|
@@ -348950,10 +348962,10 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348950
348962
|
addItem
|
|
348951
348963
|
]
|
|
348952
348964
|
);
|
|
348953
|
-
const openAuthDialog = (0,
|
|
348965
|
+
const openAuthDialog = (0, import_react102.useCallback)(() => {
|
|
348954
348966
|
setIsAuthDialogOpen(true);
|
|
348955
348967
|
}, []);
|
|
348956
|
-
const cancelAuthentication = (0,
|
|
348968
|
+
const cancelAuthentication = (0, import_react102.useCallback)(() => {
|
|
348957
348969
|
if (isAuthenticating && pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
|
|
348958
348970
|
cancelQwenAuth();
|
|
348959
348971
|
}
|
|
@@ -348965,7 +348977,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348965
348977
|
setIsAuthDialogOpen(true);
|
|
348966
348978
|
setAuthError(null);
|
|
348967
348979
|
}, [isAuthenticating, pendingAuthType, cancelQwenAuth, config]);
|
|
348968
|
-
(0,
|
|
348980
|
+
(0, import_react102.useEffect)(() => {
|
|
348969
348981
|
const defaultAuthType = process.env["QWEN_DEFAULT_AUTH_TYPE"];
|
|
348970
348982
|
if (defaultAuthType && !["qwen-oauth" /* QWEN_OAUTH */, "openai" /* USE_OPENAI */, "xhs-sso" /* XHS_SSO */].includes(
|
|
348971
348983
|
defaultAuthType
|
|
@@ -348993,7 +349005,7 @@ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem) => {
|
|
|
348993
349005
|
// packages/cli/src/ui/hooks/useQuotaAndFallback.ts
|
|
348994
349006
|
init_esbuild_shims();
|
|
348995
349007
|
init_core2();
|
|
348996
|
-
var
|
|
349008
|
+
var import_react103 = __toESM(require_react(), 1);
|
|
348997
349009
|
function useQuotaAndFallback({
|
|
348998
349010
|
config,
|
|
348999
349011
|
historyManager,
|
|
@@ -349001,9 +349013,9 @@ function useQuotaAndFallback({
|
|
|
349001
349013
|
setAuthState,
|
|
349002
349014
|
setModelSwitchedFromQuotaError
|
|
349003
349015
|
}) {
|
|
349004
|
-
const [proQuotaRequest, setProQuotaRequest] = (0,
|
|
349005
|
-
const isDialogPending = (0,
|
|
349006
|
-
(0,
|
|
349016
|
+
const [proQuotaRequest, setProQuotaRequest] = (0, import_react103.useState)(null);
|
|
349017
|
+
const isDialogPending = (0, import_react103.useRef)(false);
|
|
349018
|
+
(0, import_react103.useEffect)(() => {
|
|
349007
349019
|
const fallbackHandler = /* @__PURE__ */ __name(async (failedModel, fallbackModel, error) => {
|
|
349008
349020
|
if (config.isInFallbackMode()) {
|
|
349009
349021
|
return null;
|
|
@@ -349081,7 +349093,7 @@ function useQuotaAndFallback({
|
|
|
349081
349093
|
}, "fallbackHandler");
|
|
349082
349094
|
config.setFallbackModelHandler(fallbackHandler);
|
|
349083
349095
|
}, [config, historyManager, userTier, setModelSwitchedFromQuotaError]);
|
|
349084
|
-
const handleProQuotaChoice = (0,
|
|
349096
|
+
const handleProQuotaChoice = (0, import_react103.useCallback)(
|
|
349085
349097
|
(choice2) => {
|
|
349086
349098
|
if (!proQuotaRequest) return;
|
|
349087
349099
|
const intent = choice2 === "auth" ? "auth" : "retry";
|
|
@@ -349111,14 +349123,14 @@ __name(useQuotaAndFallback, "useQuotaAndFallback");
|
|
|
349111
349123
|
|
|
349112
349124
|
// packages/cli/src/ui/hooks/useEditorSettings.ts
|
|
349113
349125
|
init_esbuild_shims();
|
|
349114
|
-
var
|
|
349126
|
+
var import_react104 = __toESM(require_react(), 1);
|
|
349115
349127
|
init_core2();
|
|
349116
349128
|
var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError, addItem) => {
|
|
349117
|
-
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0,
|
|
349118
|
-
const openEditorDialog = (0,
|
|
349129
|
+
const [isEditorDialogOpen, setIsEditorDialogOpen] = (0, import_react104.useState)(false);
|
|
349130
|
+
const openEditorDialog = (0, import_react104.useCallback)(() => {
|
|
349119
349131
|
setIsEditorDialogOpen(true);
|
|
349120
349132
|
}, []);
|
|
349121
|
-
const handleEditorSelect = (0,
|
|
349133
|
+
const handleEditorSelect = (0, import_react104.useCallback)(
|
|
349122
349134
|
(editorType, scope) => {
|
|
349123
349135
|
if (editorType && (!checkHasEditorType(editorType) || !allowEditorTypeInSandbox(editorType))) {
|
|
349124
349136
|
return;
|
|
@@ -349140,7 +349152,7 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
349140
349152
|
},
|
|
349141
349153
|
[loadedSettings, setEditorError, addItem]
|
|
349142
349154
|
);
|
|
349143
|
-
const exitEditorDialog = (0,
|
|
349155
|
+
const exitEditorDialog = (0, import_react104.useCallback)(() => {
|
|
349144
349156
|
setIsEditorDialogOpen(false);
|
|
349145
349157
|
}, []);
|
|
349146
349158
|
return {
|
|
@@ -349153,13 +349165,13 @@ var useEditorSettings = /* @__PURE__ */ __name((loadedSettings, setEditorError,
|
|
|
349153
349165
|
|
|
349154
349166
|
// packages/cli/src/ui/hooks/useSettingsCommand.ts
|
|
349155
349167
|
init_esbuild_shims();
|
|
349156
|
-
var
|
|
349168
|
+
var import_react105 = __toESM(require_react(), 1);
|
|
349157
349169
|
function useSettingsCommand() {
|
|
349158
|
-
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0,
|
|
349159
|
-
const openSettingsDialog = (0,
|
|
349170
|
+
const [isSettingsDialogOpen, setIsSettingsDialogOpen] = (0, import_react105.useState)(false);
|
|
349171
|
+
const openSettingsDialog = (0, import_react105.useCallback)(() => {
|
|
349160
349172
|
setIsSettingsDialogOpen(true);
|
|
349161
349173
|
}, []);
|
|
349162
|
-
const closeSettingsDialog = (0,
|
|
349174
|
+
const closeSettingsDialog = (0, import_react105.useCallback)(() => {
|
|
349163
349175
|
setIsSettingsDialogOpen(false);
|
|
349164
349176
|
}, []);
|
|
349165
349177
|
return {
|
|
@@ -349172,13 +349184,13 @@ __name(useSettingsCommand, "useSettingsCommand");
|
|
|
349172
349184
|
|
|
349173
349185
|
// packages/cli/src/ui/hooks/useModelCommand.ts
|
|
349174
349186
|
init_esbuild_shims();
|
|
349175
|
-
var
|
|
349187
|
+
var import_react106 = __toESM(require_react(), 1);
|
|
349176
349188
|
var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
349177
|
-
const [isModelDialogOpen, setIsModelDialogOpen] = (0,
|
|
349178
|
-
const openModelDialog = (0,
|
|
349189
|
+
const [isModelDialogOpen, setIsModelDialogOpen] = (0, import_react106.useState)(false);
|
|
349190
|
+
const openModelDialog = (0, import_react106.useCallback)(() => {
|
|
349179
349191
|
setIsModelDialogOpen(true);
|
|
349180
349192
|
}, []);
|
|
349181
|
-
const closeModelDialog = (0,
|
|
349193
|
+
const closeModelDialog = (0, import_react106.useCallback)(() => {
|
|
349182
349194
|
setIsModelDialogOpen(false);
|
|
349183
349195
|
}, []);
|
|
349184
349196
|
return {
|
|
@@ -349190,13 +349202,13 @@ var useModelCommand = /* @__PURE__ */ __name(() => {
|
|
|
349190
349202
|
|
|
349191
349203
|
// packages/cli/src/ui/hooks/useApprovalModeCommand.ts
|
|
349192
349204
|
init_esbuild_shims();
|
|
349193
|
-
var
|
|
349205
|
+
var import_react107 = __toESM(require_react(), 1);
|
|
349194
349206
|
var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) => {
|
|
349195
|
-
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0,
|
|
349196
|
-
const openApprovalModeDialog = (0,
|
|
349207
|
+
const [isApprovalModeDialogOpen, setIsApprovalModeDialogOpen] = (0, import_react107.useState)(false);
|
|
349208
|
+
const openApprovalModeDialog = (0, import_react107.useCallback)(() => {
|
|
349197
349209
|
setIsApprovalModeDialogOpen(true);
|
|
349198
349210
|
}, []);
|
|
349199
|
-
const handleApprovalModeSelect = (0,
|
|
349211
|
+
const handleApprovalModeSelect = (0, import_react107.useCallback)(
|
|
349200
349212
|
(mode, scope) => {
|
|
349201
349213
|
try {
|
|
349202
349214
|
if (!mode) {
|
|
@@ -349222,7 +349234,7 @@ var useApprovalModeCommand = /* @__PURE__ */ __name((loadedSettings, config) =>
|
|
|
349222
349234
|
|
|
349223
349235
|
// packages/cli/src/ui/hooks/slashCommandProcessor.ts
|
|
349224
349236
|
init_esbuild_shims();
|
|
349225
|
-
var
|
|
349237
|
+
var import_react110 = __toESM(require_react(), 1);
|
|
349226
349238
|
|
|
349227
349239
|
// packages/cli/node_modules/@google/genai/dist/node/index.mjs
|
|
349228
349240
|
init_esbuild_shims();
|
|
@@ -350056,7 +350068,7 @@ ${formatUsageMessage()}`
|
|
|
350056
350068
|
|
|
350057
350069
|
// packages/cli/src/ui/commands/chatCommand.ts
|
|
350058
350070
|
init_esbuild_shims();
|
|
350059
|
-
var
|
|
350071
|
+
var import_react108 = __toESM(require_react(), 1);
|
|
350060
350072
|
import * as fsPromises5 from "node:fs/promises";
|
|
350061
350073
|
init_core2();
|
|
350062
350074
|
import path86 from "node:path";
|
|
@@ -350144,11 +350156,11 @@ var saveCommand = {
|
|
|
350144
350156
|
if (exists2) {
|
|
350145
350157
|
return {
|
|
350146
350158
|
type: "confirm_action",
|
|
350147
|
-
prompt:
|
|
350159
|
+
prompt: import_react108.default.createElement(
|
|
350148
350160
|
Text,
|
|
350149
350161
|
null,
|
|
350150
350162
|
"A checkpoint with the tag ",
|
|
350151
|
-
|
|
350163
|
+
import_react108.default.createElement(Text, { color: theme.text.accent }, tag2),
|
|
350152
350164
|
" already exists. Do you want to overwrite it?"
|
|
350153
350165
|
),
|
|
350154
350166
|
originalInvocation: {
|
|
@@ -352627,7 +352639,7 @@ init_esbuild_shims();
|
|
|
352627
352639
|
init_core2();
|
|
352628
352640
|
import * as fs81 from "node:fs";
|
|
352629
352641
|
import * as path90 from "node:path";
|
|
352630
|
-
var
|
|
352642
|
+
var import_react109 = __toESM(require_react(), 1);
|
|
352631
352643
|
var initCommand = {
|
|
352632
352644
|
name: "init",
|
|
352633
352645
|
description: "\u5206\u6790\u9879\u76EE\u5E76\u521B\u5EFA RDMind.md ",
|
|
@@ -352653,7 +352665,7 @@ var initCommand = {
|
|
|
352653
352665
|
type: "confirm_action",
|
|
352654
352666
|
// TODO: Move to .tsx file to use JSX syntax instead of React.createElement
|
|
352655
352667
|
// For now, using React.createElement to maintain .ts compatibility for PR review
|
|
352656
|
-
prompt:
|
|
352668
|
+
prompt: import_react109.default.createElement(
|
|
352657
352669
|
Text,
|
|
352658
352670
|
null,
|
|
352659
352671
|
`A ${contextFileName} file already exists in this directory. Do you want to regenerate it?`
|
|
@@ -356275,41 +356287,41 @@ var parseSlashCommand = /* @__PURE__ */ __name((query, commands) => {
|
|
|
356275
356287
|
init_extensions();
|
|
356276
356288
|
var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem, clearItems, loadHistory, refreshStatic, toggleVimEnabled, setIsProcessing, setGeminiMdFileCount, actions, extensionsUpdateState, isConfigInitialized) => {
|
|
356277
356289
|
const session = useSessionStats();
|
|
356278
|
-
const [commands, setCommands] = (0,
|
|
356279
|
-
const [reloadTrigger, setReloadTrigger] = (0,
|
|
356280
|
-
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)(() => {
|
|
356281
356293
|
setReloadTrigger((v) => v + 1);
|
|
356282
356294
|
}, []);
|
|
356283
|
-
const [shellConfirmationRequest, setShellConfirmationRequest] = (0,
|
|
356284
|
-
const [confirmationRequest, setConfirmationRequest] = (0,
|
|
356285
|
-
const [quitConfirmationRequest, setQuitConfirmationRequest] = (0,
|
|
356286
|
-
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)(
|
|
356287
356299
|
/* @__PURE__ */ new Set()
|
|
356288
356300
|
);
|
|
356289
|
-
const gitService = (0,
|
|
356301
|
+
const gitService = (0, import_react110.useMemo)(() => {
|
|
356290
356302
|
if (!config?.getProjectRoot()) {
|
|
356291
356303
|
return;
|
|
356292
356304
|
}
|
|
356293
356305
|
return new GitService(config.getProjectRoot(), config.storage);
|
|
356294
356306
|
}, [config]);
|
|
356295
|
-
const logger6 = (0,
|
|
356307
|
+
const logger6 = (0, import_react110.useMemo)(() => {
|
|
356296
356308
|
const l2 = new Logger(
|
|
356297
356309
|
config?.getSessionId() || "",
|
|
356298
356310
|
config?.storage ?? new Storage(process37.cwd())
|
|
356299
356311
|
);
|
|
356300
356312
|
return l2;
|
|
356301
356313
|
}, [config]);
|
|
356302
|
-
const [pendingItem, setPendingItem] = (0,
|
|
356314
|
+
const [pendingItem, setPendingItem] = (0, import_react110.useState)(
|
|
356303
356315
|
null
|
|
356304
356316
|
);
|
|
356305
|
-
const pendingHistoryItems = (0,
|
|
356317
|
+
const pendingHistoryItems = (0, import_react110.useMemo)(() => {
|
|
356306
356318
|
const items = [];
|
|
356307
356319
|
if (pendingItem != null) {
|
|
356308
356320
|
items.push(pendingItem);
|
|
356309
356321
|
}
|
|
356310
356322
|
return items;
|
|
356311
356323
|
}, [pendingItem]);
|
|
356312
|
-
const addMessage = (0,
|
|
356324
|
+
const addMessage = (0, import_react110.useCallback)(
|
|
356313
356325
|
(message) => {
|
|
356314
356326
|
let historyItemContent;
|
|
356315
356327
|
if (message.type === "about" /* ABOUT */) {
|
|
@@ -356365,7 +356377,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356365
356377
|
},
|
|
356366
356378
|
[addItem]
|
|
356367
356379
|
);
|
|
356368
|
-
const commandContext = (0,
|
|
356380
|
+
const commandContext = (0, import_react110.useMemo)(
|
|
356369
356381
|
() => ({
|
|
356370
356382
|
services: {
|
|
356371
356383
|
config,
|
|
@@ -356417,7 +356429,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356417
356429
|
extensionsUpdateState
|
|
356418
356430
|
]
|
|
356419
356431
|
);
|
|
356420
|
-
(0,
|
|
356432
|
+
(0, import_react110.useEffect)(() => {
|
|
356421
356433
|
if (!config) {
|
|
356422
356434
|
return;
|
|
356423
356435
|
}
|
|
@@ -356435,7 +356447,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356435
356447
|
})();
|
|
356436
356448
|
};
|
|
356437
356449
|
}, [config, reloadCommands]);
|
|
356438
|
-
(0,
|
|
356450
|
+
(0, import_react110.useEffect)(() => {
|
|
356439
356451
|
const controller = new AbortController();
|
|
356440
356452
|
const load = /* @__PURE__ */ __name(async () => {
|
|
356441
356453
|
const loaders = [
|
|
@@ -356454,7 +356466,7 @@ var useSlashCommandProcessor = /* @__PURE__ */ __name((config, settings, addItem
|
|
|
356454
356466
|
controller.abort();
|
|
356455
356467
|
};
|
|
356456
356468
|
}, [config, reloadTrigger, isConfigInitialized]);
|
|
356457
|
-
const handleSlashCommand2 = (0,
|
|
356469
|
+
const handleSlashCommand2 = (0, import_react110.useCallback)(
|
|
356458
356470
|
async (rawQuery, oneTimeShellAllowlist, overwriteConfirmed) => {
|
|
356459
356471
|
if (typeof rawQuery !== "string") {
|
|
356460
356472
|
return false;
|
|
@@ -356777,7 +356789,7 @@ ${commandToExecute.subCommands.map((sc) => ` - ${sc.name}: ${sc.description ||
|
|
|
356777
356789
|
|
|
356778
356790
|
// packages/cli/src/ui/hooks/useConsoleMessages.ts
|
|
356779
356791
|
init_esbuild_shims();
|
|
356780
|
-
var
|
|
356792
|
+
var import_react111 = __toESM(require_react(), 1);
|
|
356781
356793
|
function consoleMessagesReducer(state, action) {
|
|
356782
356794
|
switch (action.type) {
|
|
356783
356795
|
case "ADD_MESSAGES": {
|
|
@@ -356803,11 +356815,11 @@ function consoleMessagesReducer(state, action) {
|
|
|
356803
356815
|
}
|
|
356804
356816
|
__name(consoleMessagesReducer, "consoleMessagesReducer");
|
|
356805
356817
|
function useConsoleMessages() {
|
|
356806
|
-
const [consoleMessages, dispatch] = (0,
|
|
356807
|
-
const messageQueueRef = (0,
|
|
356808
|
-
const timeoutRef = (0,
|
|
356809
|
-
const [, startTransition] = (0,
|
|
356810
|
-
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)(() => {
|
|
356811
356823
|
if (messageQueueRef.current.length > 0) {
|
|
356812
356824
|
const messagesToProcess = messageQueueRef.current;
|
|
356813
356825
|
messageQueueRef.current = [];
|
|
@@ -356817,7 +356829,7 @@ function useConsoleMessages() {
|
|
|
356817
356829
|
}
|
|
356818
356830
|
timeoutRef.current = null;
|
|
356819
356831
|
}, []);
|
|
356820
|
-
const handleNewMessage = (0,
|
|
356832
|
+
const handleNewMessage = (0, import_react111.useCallback)(
|
|
356821
356833
|
(message) => {
|
|
356822
356834
|
messageQueueRef.current.push(message);
|
|
356823
356835
|
if (!timeoutRef.current) {
|
|
@@ -356826,7 +356838,7 @@ function useConsoleMessages() {
|
|
|
356826
356838
|
},
|
|
356827
356839
|
[processQueue]
|
|
356828
356840
|
);
|
|
356829
|
-
const clearConsoleMessages = (0,
|
|
356841
|
+
const clearConsoleMessages = (0, import_react111.useCallback)(() => {
|
|
356830
356842
|
if (timeoutRef.current) {
|
|
356831
356843
|
clearTimeout(timeoutRef.current);
|
|
356832
356844
|
timeoutRef.current = null;
|
|
@@ -356836,7 +356848,7 @@ function useConsoleMessages() {
|
|
|
356836
356848
|
dispatch({ type: "CLEAR" });
|
|
356837
356849
|
});
|
|
356838
356850
|
}, []);
|
|
356839
|
-
(0,
|
|
356851
|
+
(0, import_react111.useEffect)(
|
|
356840
356852
|
() => () => {
|
|
356841
356853
|
if (timeoutRef.current) {
|
|
356842
356854
|
clearTimeout(timeoutRef.current);
|
|
@@ -356866,11 +356878,11 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
356866
356878
|
|
|
356867
356879
|
// packages/cli/src/ui/hooks/useLogger.ts
|
|
356868
356880
|
init_esbuild_shims();
|
|
356869
|
-
var
|
|
356881
|
+
var import_react112 = __toESM(require_react(), 1);
|
|
356870
356882
|
init_core2();
|
|
356871
356883
|
var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
356872
|
-
const [logger6, setLogger] = (0,
|
|
356873
|
-
(0,
|
|
356884
|
+
const [logger6, setLogger] = (0, import_react112.useState)(null);
|
|
356885
|
+
(0, import_react112.useEffect)(() => {
|
|
356874
356886
|
const newLogger = new Logger(sessionId, storage);
|
|
356875
356887
|
newLogger.initialize().then(() => {
|
|
356876
356888
|
setLogger(newLogger);
|
|
@@ -356882,12 +356894,12 @@ var useLogger = /* @__PURE__ */ __name((storage) => {
|
|
|
356882
356894
|
|
|
356883
356895
|
// packages/cli/src/ui/hooks/useGeminiStream.ts
|
|
356884
356896
|
init_esbuild_shims();
|
|
356885
|
-
var
|
|
356897
|
+
var import_react117 = __toESM(require_react(), 1);
|
|
356886
356898
|
init_core2();
|
|
356887
356899
|
|
|
356888
356900
|
// packages/cli/src/ui/hooks/shellCommandProcessor.ts
|
|
356889
356901
|
init_esbuild_shims();
|
|
356890
|
-
var
|
|
356902
|
+
var import_react113 = __toESM(require_react(), 1);
|
|
356891
356903
|
init_core2();
|
|
356892
356904
|
import crypto18 from "node:crypto";
|
|
356893
356905
|
import path98 from "node:path";
|
|
@@ -356916,8 +356928,8 @@ ${modelContent}
|
|
|
356916
356928
|
}
|
|
356917
356929
|
__name(addShellCommandToGeminiHistory, "addShellCommandToGeminiHistory");
|
|
356918
356930
|
var useShellCommandProcessor = /* @__PURE__ */ __name((addItemToHistory, setPendingHistoryItem, onExec, onDebugMessage, config, geminiClient, setShellInputFocused, terminalWidth, terminalHeight) => {
|
|
356919
|
-
const [activeShellPtyId, setActiveShellPtyId] = (0,
|
|
356920
|
-
const handleShellCommand = (0,
|
|
356931
|
+
const [activeShellPtyId, setActiveShellPtyId] = (0, import_react113.useState)(null);
|
|
356932
|
+
const handleShellCommand = (0, import_react113.useCallback)(
|
|
356921
356933
|
(rawQuery, abortSignal) => {
|
|
356922
356934
|
if (typeof rawQuery !== "string" || rawQuery.trim() === "") {
|
|
356923
356935
|
return false;
|
|
@@ -357166,7 +357178,7 @@ ${finalOutput}`;
|
|
|
357166
357178
|
// packages/cli/src/ui/hooks/useVisionAutoSwitch.ts
|
|
357167
357179
|
init_esbuild_shims();
|
|
357168
357180
|
init_core2();
|
|
357169
|
-
var
|
|
357181
|
+
var import_react114 = __toESM(require_react(), 1);
|
|
357170
357182
|
init_core2();
|
|
357171
357183
|
function hasImageParts(parts) {
|
|
357172
357184
|
if (typeof parts === "string") {
|
|
@@ -357256,8 +357268,8 @@ function processVisionSwitchOutcome(outcome) {
|
|
|
357256
357268
|
}
|
|
357257
357269
|
__name(processVisionSwitchOutcome, "processVisionSwitchOutcome");
|
|
357258
357270
|
function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true, onVisionSwitchRequired) {
|
|
357259
|
-
const originalModelRef = (0,
|
|
357260
|
-
const handleVisionSwitch = (0,
|
|
357271
|
+
const originalModelRef = (0, import_react114.useRef)(null);
|
|
357272
|
+
const handleVisionSwitch = (0, import_react114.useCallback)(
|
|
357261
357273
|
async (query, userMessageTimestamp, isContinuation) => {
|
|
357262
357274
|
if (isContinuation || !onVisionSwitchRequired) {
|
|
357263
357275
|
return { shouldProceed: true };
|
|
@@ -357358,7 +357370,7 @@ function useVisionAutoSwitch(config, addItem, visionModelPreviewEnabled = true,
|
|
|
357358
357370
|
},
|
|
357359
357371
|
[config, addItem, visionModelPreviewEnabled, onVisionSwitchRequired]
|
|
357360
357372
|
);
|
|
357361
|
-
const restoreOriginalModel = (0,
|
|
357373
|
+
const restoreOriginalModel = (0, import_react114.useCallback)(async () => {
|
|
357362
357374
|
if (originalModelRef.current) {
|
|
357363
357375
|
await config.setModel(originalModelRef.current, {
|
|
357364
357376
|
reason: "vision_auto_switch",
|
|
@@ -357774,11 +357786,11 @@ var findLastSafeSplitPoint = /* @__PURE__ */ __name((content) => {
|
|
|
357774
357786
|
|
|
357775
357787
|
// packages/cli/src/ui/hooks/useStateAndRef.ts
|
|
357776
357788
|
init_esbuild_shims();
|
|
357777
|
-
var
|
|
357789
|
+
var import_react115 = __toESM(require_react(), 1);
|
|
357778
357790
|
var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
357779
|
-
const [state, setState] =
|
|
357780
|
-
const ref =
|
|
357781
|
-
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(
|
|
357782
357794
|
(newStateOrCallback) => {
|
|
357783
357795
|
let newValue;
|
|
357784
357796
|
if (typeof newStateOrCallback === "function") {
|
|
@@ -357797,10 +357809,10 @@ var useStateAndRef = /* @__PURE__ */ __name((initialValue) => {
|
|
|
357797
357809
|
// packages/cli/src/ui/hooks/useReactToolScheduler.ts
|
|
357798
357810
|
init_esbuild_shims();
|
|
357799
357811
|
init_core2();
|
|
357800
|
-
var
|
|
357812
|
+
var import_react116 = __toESM(require_react(), 1);
|
|
357801
357813
|
function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorClose) {
|
|
357802
|
-
const [toolCallsForDisplay, setToolCallsForDisplay] = (0,
|
|
357803
|
-
const outputUpdateHandler = (0,
|
|
357814
|
+
const [toolCallsForDisplay, setToolCallsForDisplay] = (0, import_react116.useState)([]);
|
|
357815
|
+
const outputUpdateHandler = (0, import_react116.useCallback)(
|
|
357804
357816
|
(toolCallId, outputChunk) => {
|
|
357805
357817
|
setToolCallsForDisplay(
|
|
357806
357818
|
(prevCalls) => prevCalls.map((tc) => {
|
|
@@ -357814,13 +357826,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357814
357826
|
},
|
|
357815
357827
|
[]
|
|
357816
357828
|
);
|
|
357817
|
-
const allToolCallsCompleteHandler = (0,
|
|
357829
|
+
const allToolCallsCompleteHandler = (0, import_react116.useCallback)(
|
|
357818
357830
|
async (completedToolCalls) => {
|
|
357819
357831
|
await onComplete(completedToolCalls);
|
|
357820
357832
|
},
|
|
357821
357833
|
[onComplete]
|
|
357822
357834
|
);
|
|
357823
|
-
const toolCallsUpdateHandler = (0,
|
|
357835
|
+
const toolCallsUpdateHandler = (0, import_react116.useCallback)(
|
|
357824
357836
|
(updatedCoreToolCalls) => {
|
|
357825
357837
|
setToolCallsForDisplay(
|
|
357826
357838
|
(prevTrackedCalls) => updatedCoreToolCalls.map((coreTc) => {
|
|
@@ -357847,7 +357859,7 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357847
357859
|
},
|
|
357848
357860
|
[setToolCallsForDisplay]
|
|
357849
357861
|
);
|
|
357850
|
-
const scheduler = (0,
|
|
357862
|
+
const scheduler = (0, import_react116.useMemo)(
|
|
357851
357863
|
() => new CoreToolScheduler({
|
|
357852
357864
|
outputUpdateHandler,
|
|
357853
357865
|
onAllToolCallsComplete: allToolCallsCompleteHandler,
|
|
@@ -357866,13 +357878,13 @@ function useReactToolScheduler(onComplete, config, getPreferredEditor, onEditorC
|
|
|
357866
357878
|
onEditorClose
|
|
357867
357879
|
]
|
|
357868
357880
|
);
|
|
357869
|
-
const schedule = (0,
|
|
357881
|
+
const schedule = (0, import_react116.useCallback)(
|
|
357870
357882
|
(request4, signal) => {
|
|
357871
357883
|
void scheduler.schedule(request4, signal);
|
|
357872
357884
|
},
|
|
357873
357885
|
[scheduler]
|
|
357874
357886
|
);
|
|
357875
|
-
const markToolsAsSubmitted = (0,
|
|
357887
|
+
const markToolsAsSubmitted = (0, import_react116.useCallback)(
|
|
357876
357888
|
(callIdsToMark) => {
|
|
357877
357889
|
setToolCallsForDisplay(
|
|
357878
357890
|
(prevCalls) => prevCalls.map(
|
|
@@ -358021,18 +358033,18 @@ function showCitations(settings) {
|
|
|
358021
358033
|
}
|
|
358022
358034
|
__name(showCitations, "showCitations");
|
|
358023
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) => {
|
|
358024
|
-
const [initError, setInitError] = (0,
|
|
358025
|
-
const abortControllerRef = (0,
|
|
358026
|
-
const turnCancelledRef = (0,
|
|
358027
|
-
const isSubmittingQueryRef = (0,
|
|
358028
|
-
const [isResponding, setIsResponding] = (0,
|
|
358029
|
-
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);
|
|
358030
358042
|
const [pendingHistoryItem, pendingHistoryItemRef, setPendingHistoryItem] = useStateAndRef(null);
|
|
358031
|
-
const processedMemoryToolsRef = (0,
|
|
358043
|
+
const processedMemoryToolsRef = (0, import_react117.useRef)(/* @__PURE__ */ new Set());
|
|
358032
358044
|
const { startNewPrompt, getPromptCount } = useSessionStats();
|
|
358033
358045
|
const storage = config.storage;
|
|
358034
358046
|
const logger6 = useLogger(storage);
|
|
358035
|
-
const gitService = (0,
|
|
358047
|
+
const gitService = (0, import_react117.useMemo)(() => {
|
|
358036
358048
|
if (!config.getProjectRoot()) {
|
|
358037
358049
|
return;
|
|
358038
358050
|
}
|
|
@@ -358056,11 +358068,11 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358056
358068
|
getPreferredEditor,
|
|
358057
358069
|
onEditorClose
|
|
358058
358070
|
);
|
|
358059
|
-
const pendingToolCallGroupDisplay = (0,
|
|
358071
|
+
const pendingToolCallGroupDisplay = (0, import_react117.useMemo)(
|
|
358060
358072
|
() => toolCalls.length ? mapToDisplay(toolCalls) : void 0,
|
|
358061
358073
|
[toolCalls]
|
|
358062
358074
|
);
|
|
358063
|
-
const activeToolPtyId = (0,
|
|
358075
|
+
const activeToolPtyId = (0, import_react117.useMemo)(() => {
|
|
358064
358076
|
const executingShellTool = toolCalls?.find(
|
|
358065
358077
|
(tc) => tc.status === "executing" && tc.request.name === "run_shell_command"
|
|
358066
358078
|
);
|
|
@@ -358069,12 +358081,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358069
358081
|
}
|
|
358070
358082
|
return void 0;
|
|
358071
358083
|
}, [toolCalls]);
|
|
358072
|
-
const loopDetectedRef = (0,
|
|
358084
|
+
const loopDetectedRef = (0, import_react117.useRef)(false);
|
|
358073
358085
|
const [
|
|
358074
358086
|
loopDetectionConfirmationRequest,
|
|
358075
358087
|
setLoopDetectionConfirmationRequest
|
|
358076
|
-
] = (0,
|
|
358077
|
-
const onExec = (0,
|
|
358088
|
+
] = (0, import_react117.useState)(null);
|
|
358089
|
+
const onExec = (0, import_react117.useCallback)(async (done) => {
|
|
358078
358090
|
setIsResponding(true);
|
|
358079
358091
|
await done;
|
|
358080
358092
|
setIsResponding(false);
|
|
@@ -358097,12 +358109,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358097
358109
|
onVisionSwitchRequired
|
|
358098
358110
|
);
|
|
358099
358111
|
const activePtyId = activeShellPtyId || activeToolPtyId;
|
|
358100
|
-
(0,
|
|
358112
|
+
(0, import_react117.useEffect)(() => {
|
|
358101
358113
|
if (!activePtyId) {
|
|
358102
358114
|
setShellInputFocused(false);
|
|
358103
358115
|
}
|
|
358104
358116
|
}, [activePtyId, setShellInputFocused]);
|
|
358105
|
-
const streamingState = (0,
|
|
358117
|
+
const streamingState = (0, import_react117.useMemo)(() => {
|
|
358106
358118
|
if (toolCalls.some((tc) => tc.status === "awaiting_approval")) {
|
|
358107
358119
|
return "waiting_for_confirmation" /* WaitingForConfirmation */;
|
|
358108
358120
|
}
|
|
@@ -358113,7 +358125,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358113
358125
|
}
|
|
358114
358126
|
return "idle" /* Idle */;
|
|
358115
358127
|
}, [isResponding, toolCalls]);
|
|
358116
|
-
(0,
|
|
358128
|
+
(0, import_react117.useEffect)(() => {
|
|
358117
358129
|
if (config.getApprovalMode() === "yolo" /* YOLO */ && streamingState === "idle" /* Idle */) {
|
|
358118
358130
|
const lastUserMessageIndex = history.findLastIndex(
|
|
358119
358131
|
(item) => item.type === "user" /* USER */
|
|
@@ -358127,7 +358139,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358127
358139
|
}
|
|
358128
358140
|
}
|
|
358129
358141
|
}, [streamingState, config, history]);
|
|
358130
|
-
const cancelOngoingRequest = (0,
|
|
358142
|
+
const cancelOngoingRequest = (0, import_react117.useCallback)(() => {
|
|
358131
358143
|
if (streamingState !== "responding" /* Responding */) {
|
|
358132
358144
|
return;
|
|
358133
358145
|
}
|
|
@@ -358176,7 +358188,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358176
358188
|
},
|
|
358177
358189
|
{ isActive: streamingState === "responding" /* Responding */ }
|
|
358178
358190
|
);
|
|
358179
|
-
const prepareQueryForGemini = (0,
|
|
358191
|
+
const prepareQueryForGemini = (0, import_react117.useCallback)(
|
|
358180
358192
|
async (query, userMessageTimestamp, abortSignal, prompt_id) => {
|
|
358181
358193
|
if (turnCancelledRef.current) {
|
|
358182
358194
|
return { queryToSend: null, shouldProceed: false };
|
|
@@ -358271,7 +358283,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358271
358283
|
scheduleToolCalls
|
|
358272
358284
|
]
|
|
358273
358285
|
);
|
|
358274
|
-
const handleContentEvent = (0,
|
|
358286
|
+
const handleContentEvent = (0, import_react117.useCallback)(
|
|
358275
358287
|
(eventValue, currentGeminiMessageBuffer, userMessageTimestamp) => {
|
|
358276
358288
|
if (turnCancelledRef.current) {
|
|
358277
358289
|
return "";
|
|
@@ -358307,7 +358319,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358307
358319
|
},
|
|
358308
358320
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem]
|
|
358309
358321
|
);
|
|
358310
|
-
const handleUserCancelledEvent = (0,
|
|
358322
|
+
const handleUserCancelledEvent = (0, import_react117.useCallback)(
|
|
358311
358323
|
(userMessageTimestamp) => {
|
|
358312
358324
|
if (turnCancelledRef.current) {
|
|
358313
358325
|
return;
|
|
@@ -358336,7 +358348,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358336
358348
|
},
|
|
358337
358349
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, setThought]
|
|
358338
358350
|
);
|
|
358339
|
-
const handleErrorEvent = (0,
|
|
358351
|
+
const handleErrorEvent = (0, import_react117.useCallback)(
|
|
358340
358352
|
(eventValue, userMessageTimestamp) => {
|
|
358341
358353
|
if (pendingHistoryItemRef.current) {
|
|
358342
358354
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -358359,7 +358371,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358359
358371
|
},
|
|
358360
358372
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, config, setThought]
|
|
358361
358373
|
);
|
|
358362
|
-
const handleCitationEvent = (0,
|
|
358374
|
+
const handleCitationEvent = (0, import_react117.useCallback)(
|
|
358363
358375
|
(text, userMessageTimestamp) => {
|
|
358364
358376
|
if (!showCitations(settings)) {
|
|
358365
358377
|
return;
|
|
@@ -358372,7 +358384,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358372
358384
|
},
|
|
358373
358385
|
[addItem, pendingHistoryItemRef, setPendingHistoryItem, settings]
|
|
358374
358386
|
);
|
|
358375
|
-
const handleFinishedEvent = (0,
|
|
358387
|
+
const handleFinishedEvent = (0, import_react117.useCallback)(
|
|
358376
358388
|
(event, userMessageTimestamp) => {
|
|
358377
358389
|
const finishReason = event.value.reason;
|
|
358378
358390
|
if (!finishReason) {
|
|
@@ -358406,7 +358418,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358406
358418
|
},
|
|
358407
358419
|
[addItem]
|
|
358408
358420
|
);
|
|
358409
|
-
const handleChatCompressionEvent = (0,
|
|
358421
|
+
const handleChatCompressionEvent = (0, import_react117.useCallback)(
|
|
358410
358422
|
(eventValue, userMessageTimestamp) => {
|
|
358411
358423
|
if (pendingHistoryItemRef.current) {
|
|
358412
358424
|
addItem(pendingHistoryItemRef.current, userMessageTimestamp);
|
|
@@ -358422,7 +358434,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358422
358434
|
},
|
|
358423
358435
|
[addItem, config, pendingHistoryItemRef, setPendingHistoryItem]
|
|
358424
358436
|
);
|
|
358425
|
-
const handleMaxSessionTurnsEvent = (0,
|
|
358437
|
+
const handleMaxSessionTurnsEvent = (0, import_react117.useCallback)(
|
|
358426
358438
|
() => addItem(
|
|
358427
358439
|
{
|
|
358428
358440
|
type: "info",
|
|
@@ -358432,7 +358444,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358432
358444
|
),
|
|
358433
358445
|
[addItem, config]
|
|
358434
358446
|
);
|
|
358435
|
-
const handleSessionTokenLimitExceededEvent = (0,
|
|
358447
|
+
const handleSessionTokenLimitExceededEvent = (0, import_react117.useCallback)(
|
|
358436
358448
|
(value) => addItem(
|
|
358437
358449
|
{
|
|
358438
358450
|
type: "error",
|
|
@@ -358447,7 +358459,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358447
358459
|
),
|
|
358448
358460
|
[addItem]
|
|
358449
358461
|
);
|
|
358450
|
-
const handleLoopDetectionConfirmation = (0,
|
|
358462
|
+
const handleLoopDetectionConfirmation = (0, import_react117.useCallback)(
|
|
358451
358463
|
(result) => {
|
|
358452
358464
|
setLoopDetectionConfirmationRequest(null);
|
|
358453
358465
|
if (result.userSelection === "disable") {
|
|
@@ -358471,12 +358483,12 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358471
358483
|
},
|
|
358472
358484
|
[config, addItem]
|
|
358473
358485
|
);
|
|
358474
|
-
const handleLoopDetectedEvent = (0,
|
|
358486
|
+
const handleLoopDetectedEvent = (0, import_react117.useCallback)(() => {
|
|
358475
358487
|
setLoopDetectionConfirmationRequest({
|
|
358476
358488
|
onComplete: handleLoopDetectionConfirmation
|
|
358477
358489
|
});
|
|
358478
358490
|
}, [handleLoopDetectionConfirmation]);
|
|
358479
|
-
const processGeminiStreamEvents = (0,
|
|
358491
|
+
const processGeminiStreamEvents = (0, import_react117.useCallback)(
|
|
358480
358492
|
async (stream2, userMessageTimestamp, signal) => {
|
|
358481
358493
|
let geminiMessageBuffer = "";
|
|
358482
358494
|
const toolCallRequests = [];
|
|
@@ -358550,7 +358562,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358550
358562
|
handleCitationEvent
|
|
358551
358563
|
]
|
|
358552
358564
|
);
|
|
358553
|
-
const submitQuery = (0,
|
|
358565
|
+
const submitQuery = (0, import_react117.useCallback)(
|
|
358554
358566
|
async (query, options2, prompt_id) => {
|
|
358555
358567
|
if (isSubmittingQueryRef.current && !options2?.isContinuation) {
|
|
358556
358568
|
return;
|
|
@@ -358683,7 +358695,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358683
358695
|
restoreOriginalModel
|
|
358684
358696
|
]
|
|
358685
358697
|
);
|
|
358686
|
-
const handleApprovalModeChange = (0,
|
|
358698
|
+
const handleApprovalModeChange = (0, import_react117.useCallback)(
|
|
358687
358699
|
async (newApprovalMode) => {
|
|
358688
358700
|
if (newApprovalMode === "yolo" /* YOLO */ || newApprovalMode === "auto-edit" /* AUTO_EDIT */) {
|
|
358689
358701
|
let awaitingApprovalCalls = toolCalls.filter(
|
|
@@ -358712,7 +358724,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358712
358724
|
},
|
|
358713
358725
|
[toolCalls]
|
|
358714
358726
|
);
|
|
358715
|
-
const handleCompletedTools = (0,
|
|
358727
|
+
const handleCompletedTools = (0, import_react117.useCallback)(
|
|
358716
358728
|
async (completedToolCallsFromScheduler) => {
|
|
358717
358729
|
if (isResponding) {
|
|
358718
358730
|
return;
|
|
@@ -358797,13 +358809,13 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358797
358809
|
modelSwitchedFromQuotaError
|
|
358798
358810
|
]
|
|
358799
358811
|
);
|
|
358800
|
-
const pendingHistoryItems = (0,
|
|
358812
|
+
const pendingHistoryItems = (0, import_react117.useMemo)(
|
|
358801
358813
|
() => [pendingHistoryItem, pendingToolCallGroupDisplay].filter(
|
|
358802
358814
|
(i) => i !== void 0 && i !== null
|
|
358803
358815
|
),
|
|
358804
358816
|
[pendingHistoryItem, pendingToolCallGroupDisplay]
|
|
358805
358817
|
);
|
|
358806
|
-
(0,
|
|
358818
|
+
(0, import_react117.useEffect)(() => {
|
|
358807
358819
|
const saveRestorableToolCalls = /* @__PURE__ */ __name(async () => {
|
|
358808
358820
|
if (!config.getCheckpointingEnabled()) {
|
|
358809
358821
|
return;
|
|
@@ -358922,7 +358934,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
358922
358934
|
|
|
358923
358935
|
// packages/cli/src/ui/hooks/vim.ts
|
|
358924
358936
|
init_esbuild_shims();
|
|
358925
|
-
var
|
|
358937
|
+
var import_react118 = __toESM(require_react(), 1);
|
|
358926
358938
|
var DIGIT_MULTIPLIER = 10;
|
|
358927
358939
|
var DEFAULT_COUNT = 1;
|
|
358928
358940
|
var DIGIT_1_TO_9 = /^[1-9]$/;
|
|
@@ -358985,22 +358997,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
358985
358997
|
}, "vimReducer");
|
|
358986
358998
|
function useVim(buffer, onSubmit) {
|
|
358987
358999
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
358988
|
-
const [state, dispatch] = (0,
|
|
358989
|
-
(0,
|
|
359000
|
+
const [state, dispatch] = (0, import_react118.useReducer)(vimReducer, initialVimState);
|
|
359001
|
+
(0, import_react118.useEffect)(() => {
|
|
358990
359002
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
358991
359003
|
}, [vimMode]);
|
|
358992
|
-
const updateMode = (0,
|
|
359004
|
+
const updateMode = (0, import_react118.useCallback)(
|
|
358993
359005
|
(mode) => {
|
|
358994
359006
|
setVimMode(mode);
|
|
358995
359007
|
dispatch({ type: "SET_MODE", mode });
|
|
358996
359008
|
},
|
|
358997
359009
|
[setVimMode]
|
|
358998
359010
|
);
|
|
358999
|
-
const getCurrentCount = (0,
|
|
359011
|
+
const getCurrentCount = (0, import_react118.useCallback)(
|
|
359000
359012
|
() => state.count || DEFAULT_COUNT,
|
|
359001
359013
|
[state.count]
|
|
359002
359014
|
);
|
|
359003
|
-
const executeCommand = (0,
|
|
359015
|
+
const executeCommand = (0, import_react118.useCallback)(
|
|
359004
359016
|
(cmdType, count) => {
|
|
359005
359017
|
switch (cmdType) {
|
|
359006
359018
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -359076,7 +359088,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359076
359088
|
},
|
|
359077
359089
|
[buffer, updateMode]
|
|
359078
359090
|
);
|
|
359079
|
-
const handleInsertModeInput = (0,
|
|
359091
|
+
const handleInsertModeInput = (0, import_react118.useCallback)(
|
|
359080
359092
|
(normalizedKey) => {
|
|
359081
359093
|
if (normalizedKey.name === "escape") {
|
|
359082
359094
|
buffer.vimEscapeInsertMode();
|
|
@@ -359107,7 +359119,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359107
359119
|
},
|
|
359108
359120
|
[buffer, dispatch, updateMode, onSubmit]
|
|
359109
359121
|
);
|
|
359110
|
-
const normalizeKey = (0,
|
|
359122
|
+
const normalizeKey = (0, import_react118.useCallback)(
|
|
359111
359123
|
(key) => ({
|
|
359112
359124
|
name: key.name || "",
|
|
359113
359125
|
sequence: key.sequence || "",
|
|
@@ -359118,7 +359130,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359118
359130
|
}),
|
|
359119
359131
|
[]
|
|
359120
359132
|
);
|
|
359121
|
-
const handleChangeMovement = (0,
|
|
359133
|
+
const handleChangeMovement = (0, import_react118.useCallback)(
|
|
359122
359134
|
(movement) => {
|
|
359123
359135
|
const count = getCurrentCount();
|
|
359124
359136
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -359139,7 +359151,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359139
359151
|
},
|
|
359140
359152
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
359141
359153
|
);
|
|
359142
|
-
const handleOperatorMotion = (0,
|
|
359154
|
+
const handleOperatorMotion = (0, import_react118.useCallback)(
|
|
359143
359155
|
(operator2, motion) => {
|
|
359144
359156
|
const count = getCurrentCount();
|
|
359145
359157
|
const commandMap = {
|
|
@@ -359166,7 +359178,7 @@ function useVim(buffer, onSubmit) {
|
|
|
359166
359178
|
},
|
|
359167
359179
|
[getCurrentCount, executeCommand, dispatch]
|
|
359168
359180
|
);
|
|
359169
|
-
const handleInput = (0,
|
|
359181
|
+
const handleInput = (0, import_react118.useCallback)(
|
|
359170
359182
|
(key) => {
|
|
359171
359183
|
if (!vimEnabled) {
|
|
359172
359184
|
return false;
|
|
@@ -359534,14 +359546,14 @@ __name(initializeApp, "initializeApp");
|
|
|
359534
359546
|
|
|
359535
359547
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
359536
359548
|
init_esbuild_shims();
|
|
359537
|
-
var
|
|
359549
|
+
var import_react119 = __toESM(require_react(), 1);
|
|
359538
359550
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
359539
359551
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
359540
359552
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
359541
359553
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
359542
359554
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
359543
359555
|
}, "cleanup");
|
|
359544
|
-
(0,
|
|
359556
|
+
(0, import_react119.useEffect)(() => {
|
|
359545
359557
|
process.stdout.write(ENABLE_BRACKETED_PASTE);
|
|
359546
359558
|
process.on("exit", cleanup);
|
|
359547
359559
|
process.on("SIGINT", cleanup);
|
|
@@ -359560,13 +359572,13 @@ init_esbuild_shims();
|
|
|
359560
359572
|
|
|
359561
359573
|
// packages/cli/src/ui/hooks/useTimer.ts
|
|
359562
359574
|
init_esbuild_shims();
|
|
359563
|
-
var
|
|
359575
|
+
var import_react120 = __toESM(require_react(), 1);
|
|
359564
359576
|
var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
359565
|
-
const [elapsedTime, setElapsedTime] = (0,
|
|
359566
|
-
const timerRef = (0,
|
|
359567
|
-
const prevResetKeyRef = (0,
|
|
359568
|
-
const prevIsActiveRef = (0,
|
|
359569
|
-
(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)(() => {
|
|
359570
359582
|
let shouldResetTime = false;
|
|
359571
359583
|
if (prevResetKeyRef.current !== resetKey) {
|
|
359572
359584
|
shouldResetTime = true;
|
|
@@ -359604,7 +359616,7 @@ var useTimer = /* @__PURE__ */ __name((isActive, resetKey) => {
|
|
|
359604
359616
|
|
|
359605
359617
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
359606
359618
|
init_esbuild_shims();
|
|
359607
|
-
var
|
|
359619
|
+
var import_react121 = __toESM(require_react(), 1);
|
|
359608
359620
|
var WITTY_LOADING_PHRASES = [
|
|
359609
359621
|
"\u51AC\u74DC\u3001\u9EC4\u74DC\u3001\u897F\u74DC\u3001\u5357\u74DC\u90FD\u80FD\u5403\uFF0C\u4EC0\u4E48\u74DC\u4E0D\u80FD\u5403\uFF1F",
|
|
359610
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",
|
|
@@ -359709,11 +359721,11 @@ var WITTY_LOADING_PHRASES = [
|
|
|
359709
359721
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
359710
359722
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
359711
359723
|
const loadingPhrases = customPhrases && customPhrases.length > 0 ? customPhrases : WITTY_LOADING_PHRASES;
|
|
359712
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
359724
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react121.useState)(
|
|
359713
359725
|
loadingPhrases[0]
|
|
359714
359726
|
);
|
|
359715
|
-
const phraseIntervalRef = (0,
|
|
359716
|
-
(0,
|
|
359727
|
+
const phraseIntervalRef = (0, import_react121.useRef)(null);
|
|
359728
|
+
(0, import_react121.useEffect)(() => {
|
|
359717
359729
|
if (isWaiting) {
|
|
359718
359730
|
setCurrentLoadingPhrase("Waiting for user confirmation...");
|
|
359719
359731
|
if (phraseIntervalRef.current) {
|
|
@@ -359750,9 +359762,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
359750
359762
|
}, "usePhraseCycler");
|
|
359751
359763
|
|
|
359752
359764
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
359753
|
-
var
|
|
359765
|
+
var import_react122 = __toESM(require_react(), 1);
|
|
359754
359766
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases) => {
|
|
359755
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
359767
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react122.useState)(0);
|
|
359756
359768
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
359757
359769
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
359758
359770
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -359762,9 +359774,9 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
359762
359774
|
isWaiting,
|
|
359763
359775
|
customWittyPhrases
|
|
359764
359776
|
);
|
|
359765
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
359766
|
-
const prevStreamingStateRef = (0,
|
|
359767
|
-
(0,
|
|
359777
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react122.useState)(0);
|
|
359778
|
+
const prevStreamingStateRef = (0, import_react122.useRef)(null);
|
|
359779
|
+
(0, import_react122.useEffect)(() => {
|
|
359768
359780
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
359769
359781
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
359770
359782
|
setRetainedElapsedTime(0);
|
|
@@ -359784,21 +359796,21 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
359784
359796
|
|
|
359785
359797
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
359786
359798
|
init_esbuild_shims();
|
|
359787
|
-
var
|
|
359799
|
+
var import_react123 = __toESM(require_react(), 1);
|
|
359788
359800
|
init_trustedFolders();
|
|
359789
359801
|
import * as process38 from "node:process";
|
|
359790
359802
|
var useFolderTrust = /* @__PURE__ */ __name((settings, onTrustChange) => {
|
|
359791
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
359792
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
359793
|
-
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);
|
|
359794
359806
|
const folderTrust = settings.merged.security?.folderTrust?.enabled;
|
|
359795
|
-
(0,
|
|
359807
|
+
(0, import_react123.useEffect)(() => {
|
|
359796
359808
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings.merged);
|
|
359797
359809
|
setIsTrusted(trusted);
|
|
359798
359810
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
359799
359811
|
onTrustChange(trusted);
|
|
359800
359812
|
}, [folderTrust, onTrustChange, settings.merged]);
|
|
359801
|
-
const handleFolderTrustSelect = (0,
|
|
359813
|
+
const handleFolderTrustSelect = (0, import_react123.useCallback)(
|
|
359802
359814
|
(choice2) => {
|
|
359803
359815
|
const trustedFolders = loadTrustedFolders();
|
|
359804
359816
|
const cwd7 = process38.cwd();
|
|
@@ -362983,27 +362995,27 @@ var ConsolePatcher = class {
|
|
|
362983
362995
|
|
|
362984
362996
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
362985
362997
|
init_esbuild_shims();
|
|
362986
|
-
var
|
|
362998
|
+
var import_react124 = __toESM(require_react(), 1);
|
|
362987
362999
|
function useMessageQueue({
|
|
362988
363000
|
isConfigInitialized,
|
|
362989
363001
|
streamingState,
|
|
362990
363002
|
submitQuery
|
|
362991
363003
|
}) {
|
|
362992
|
-
const [messageQueue, setMessageQueue] = (0,
|
|
362993
|
-
const addMessage = (0,
|
|
363004
|
+
const [messageQueue, setMessageQueue] = (0, import_react124.useState)([]);
|
|
363005
|
+
const addMessage = (0, import_react124.useCallback)((message) => {
|
|
362994
363006
|
const trimmedMessage = message.trim();
|
|
362995
363007
|
if (trimmedMessage.length > 0) {
|
|
362996
363008
|
setMessageQueue((prev) => [...prev, trimmedMessage]);
|
|
362997
363009
|
}
|
|
362998
363010
|
}, []);
|
|
362999
|
-
const clearQueue = (0,
|
|
363011
|
+
const clearQueue = (0, import_react124.useCallback)(() => {
|
|
363000
363012
|
setMessageQueue([]);
|
|
363001
363013
|
}, []);
|
|
363002
|
-
const getQueuedMessagesText = (0,
|
|
363014
|
+
const getQueuedMessagesText = (0, import_react124.useCallback)(() => {
|
|
363003
363015
|
if (messageQueue.length === 0) return "";
|
|
363004
363016
|
return messageQueue.join("\n\n");
|
|
363005
363017
|
}, [messageQueue]);
|
|
363006
|
-
(0,
|
|
363018
|
+
(0, import_react124.useEffect)(() => {
|
|
363007
363019
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
363008
363020
|
const combinedMessage = messageQueue.join("\n\n");
|
|
363009
363021
|
setMessageQueue([]);
|
|
@@ -363022,15 +363034,15 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
363022
363034
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
363023
363035
|
init_esbuild_shims();
|
|
363024
363036
|
init_core2();
|
|
363025
|
-
var
|
|
363037
|
+
var import_react125 = __toESM(require_react(), 1);
|
|
363026
363038
|
function useAutoAcceptIndicator({
|
|
363027
363039
|
config,
|
|
363028
363040
|
addItem,
|
|
363029
363041
|
onApprovalModeChange
|
|
363030
363042
|
}) {
|
|
363031
363043
|
const currentConfigValue = config.getApprovalMode();
|
|
363032
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
363033
|
-
(0,
|
|
363044
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react125.useState)(currentConfigValue);
|
|
363045
|
+
(0, import_react125.useEffect)(() => {
|
|
363034
363046
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
363035
363047
|
}, [currentConfigValue]);
|
|
363036
363048
|
useKeypress(
|
|
@@ -363063,16 +363075,16 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
363063
363075
|
|
|
363064
363076
|
// packages/cli/src/ui/hooks/useWorkspaceMigration.ts
|
|
363065
363077
|
init_esbuild_shims();
|
|
363066
|
-
var
|
|
363078
|
+
var import_react126 = __toESM(require_react(), 1);
|
|
363067
363079
|
init_extension();
|
|
363068
363080
|
init_settings();
|
|
363069
363081
|
import process48 from "node:process";
|
|
363070
363082
|
function useWorkspaceMigration(settings) {
|
|
363071
|
-
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0,
|
|
363072
|
-
const [workspaceExtensions, setWorkspaceExtensions] = (0,
|
|
363083
|
+
const [showWorkspaceMigrationDialog, setShowWorkspaceMigrationDialog] = (0, import_react126.useState)(false);
|
|
363084
|
+
const [workspaceExtensions, setWorkspaceExtensions] = (0, import_react126.useState)(
|
|
363073
363085
|
[]
|
|
363074
363086
|
);
|
|
363075
|
-
(0,
|
|
363087
|
+
(0, import_react126.useEffect)(() => {
|
|
363076
363088
|
if (!(settings.merged.experimental?.extensionManagement ?? true)) {
|
|
363077
363089
|
return;
|
|
363078
363090
|
}
|
|
@@ -363114,14 +363126,14 @@ __name(useWorkspaceMigration, "useWorkspaceMigration");
|
|
|
363114
363126
|
|
|
363115
363127
|
// packages/cli/src/ui/hooks/useGitBranchName.ts
|
|
363116
363128
|
init_esbuild_shims();
|
|
363117
|
-
var
|
|
363129
|
+
var import_react127 = __toESM(require_react(), 1);
|
|
363118
363130
|
init_core2();
|
|
363119
363131
|
import fs96 from "node:fs";
|
|
363120
363132
|
import fsPromises7 from "node:fs/promises";
|
|
363121
363133
|
import path110 from "node:path";
|
|
363122
363134
|
function useGitBranchName(cwd7) {
|
|
363123
|
-
const [branchName, setBranchName] = (0,
|
|
363124
|
-
const fetchBranchName = (0,
|
|
363135
|
+
const [branchName, setBranchName] = (0, import_react127.useState)(void 0);
|
|
363136
|
+
const fetchBranchName = (0, import_react127.useCallback)(async () => {
|
|
363125
363137
|
try {
|
|
363126
363138
|
if (!isCommandAvailable("git").available) {
|
|
363127
363139
|
return;
|
|
@@ -363146,7 +363158,7 @@ function useGitBranchName(cwd7) {
|
|
|
363146
363158
|
setBranchName(void 0);
|
|
363147
363159
|
}
|
|
363148
363160
|
}, [cwd7, setBranchName]);
|
|
363149
|
-
(0,
|
|
363161
|
+
(0, import_react127.useEffect)(() => {
|
|
363150
363162
|
fetchBranchName();
|
|
363151
363163
|
const gitLogsHeadPath = path110.join(cwd7, ".git", "logs", "HEAD");
|
|
363152
363164
|
let watcher;
|
|
@@ -363174,7 +363186,7 @@ __name(useGitBranchName, "useGitBranchName");
|
|
|
363174
363186
|
init_esbuild_shims();
|
|
363175
363187
|
init_errors4();
|
|
363176
363188
|
init_extensions();
|
|
363177
|
-
var
|
|
363189
|
+
var import_react128 = __toESM(require_react(), 1);
|
|
363178
363190
|
init_extension();
|
|
363179
363191
|
init_checks();
|
|
363180
363192
|
function confirmationRequestsReducer(state, action) {
|
|
@@ -363190,15 +363202,15 @@ function confirmationRequestsReducer(state, action) {
|
|
|
363190
363202
|
}
|
|
363191
363203
|
__name(confirmationRequestsReducer, "confirmationRequestsReducer");
|
|
363192
363204
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) => {
|
|
363193
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
363205
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react128.useReducer)(
|
|
363194
363206
|
extensionUpdatesReducer,
|
|
363195
363207
|
initialExtensionUpdatesState
|
|
363196
363208
|
);
|
|
363197
363209
|
const [
|
|
363198
363210
|
confirmUpdateExtensionRequests,
|
|
363199
363211
|
dispatchConfirmUpdateExtensionRequests
|
|
363200
|
-
] = (0,
|
|
363201
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
363212
|
+
] = (0, import_react128.useReducer)(confirmationRequestsReducer, []);
|
|
363213
|
+
const addConfirmUpdateExtensionRequest = (0, import_react128.useCallback)(
|
|
363202
363214
|
(original) => {
|
|
363203
363215
|
const wrappedRequest = {
|
|
363204
363216
|
prompt: original.prompt,
|
|
@@ -363217,7 +363229,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363217
363229
|
},
|
|
363218
363230
|
[dispatchConfirmUpdateExtensionRequests]
|
|
363219
363231
|
);
|
|
363220
|
-
(0,
|
|
363232
|
+
(0, import_react128.useEffect)(() => {
|
|
363221
363233
|
(async () => {
|
|
363222
363234
|
await checkForAllExtensionUpdates(
|
|
363223
363235
|
extensions,
|
|
@@ -363225,7 +363237,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363225
363237
|
);
|
|
363226
363238
|
})();
|
|
363227
363239
|
}, [extensions, extensions.length, dispatchExtensionStateUpdate]);
|
|
363228
|
-
(0,
|
|
363240
|
+
(0, import_react128.useEffect)(() => {
|
|
363229
363241
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
363230
363242
|
return;
|
|
363231
363243
|
}
|
|
@@ -363290,7 +363302,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363290
363302
|
addItem,
|
|
363291
363303
|
cwd7
|
|
363292
363304
|
]);
|
|
363293
|
-
const extensionsUpdateStateComputed = (0,
|
|
363305
|
+
const extensionsUpdateStateComputed = (0, import_react128.useMemo)(() => {
|
|
363294
363306
|
const result = /* @__PURE__ */ new Map();
|
|
363295
363307
|
for (const [
|
|
363296
363308
|
key,
|
|
@@ -363311,13 +363323,13 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensions, addItem, cwd7) =>
|
|
|
363311
363323
|
|
|
363312
363324
|
// packages/cli/src/ui/hooks/useQuitConfirmation.ts
|
|
363313
363325
|
init_esbuild_shims();
|
|
363314
|
-
var
|
|
363326
|
+
var import_react129 = __toESM(require_react(), 1);
|
|
363315
363327
|
var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
363316
|
-
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0,
|
|
363317
|
-
const showQuitConfirmation = (0,
|
|
363328
|
+
const [isQuitConfirmationOpen, setIsQuitConfirmationOpen] = (0, import_react129.useState)(false);
|
|
363329
|
+
const showQuitConfirmation = (0, import_react129.useCallback)(() => {
|
|
363318
363330
|
setIsQuitConfirmationOpen(true);
|
|
363319
363331
|
}, []);
|
|
363320
|
-
const handleQuitConfirmationSelect = (0,
|
|
363332
|
+
const handleQuitConfirmationSelect = (0, import_react129.useCallback)((choice2) => {
|
|
363321
363333
|
setIsQuitConfirmationOpen(false);
|
|
363322
363334
|
if (choice2 === "cancel" /* CANCEL */) {
|
|
363323
363335
|
return { shouldQuit: false, action: "cancel" };
|
|
@@ -363339,16 +363351,16 @@ var useQuitConfirmation = /* @__PURE__ */ __name(() => {
|
|
|
363339
363351
|
|
|
363340
363352
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
363341
363353
|
init_esbuild_shims();
|
|
363342
|
-
var
|
|
363354
|
+
var import_react130 = __toESM(require_react(), 1);
|
|
363343
363355
|
init_core2();
|
|
363344
363356
|
init_settingsSchema();
|
|
363345
363357
|
function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
363346
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
363347
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
363348
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
363349
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
363350
|
-
const [inputFillText, setInputFillText] = (0,
|
|
363351
|
-
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 () => {
|
|
363352
363364
|
if (settings.ui?.enableWelcomeBack === false) {
|
|
363353
363365
|
return;
|
|
363354
363366
|
}
|
|
@@ -363362,7 +363374,7 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
363362
363374
|
console.debug("Welcome back check failed:", error);
|
|
363363
363375
|
}
|
|
363364
363376
|
}, [settings.ui?.enableWelcomeBack]);
|
|
363365
|
-
const handleWelcomeBackSelection = (0,
|
|
363377
|
+
const handleWelcomeBackSelection = (0, import_react130.useCallback)(
|
|
363366
363378
|
(choice2) => {
|
|
363367
363379
|
setWelcomeBackChoice(choice2);
|
|
363368
363380
|
setShowWelcomeBackDialog(false);
|
|
@@ -363374,21 +363386,21 @@ function useWelcomeBack(config, submitQuery, buffer, settings) {
|
|
|
363374
363386
|
},
|
|
363375
363387
|
[welcomeBackInfo]
|
|
363376
363388
|
);
|
|
363377
|
-
const handleWelcomeBackClose = (0,
|
|
363389
|
+
const handleWelcomeBackClose = (0, import_react130.useCallback)(() => {
|
|
363378
363390
|
setWelcomeBackChoice("restart");
|
|
363379
363391
|
setShowWelcomeBackDialog(false);
|
|
363380
363392
|
}, []);
|
|
363381
|
-
const clearInputFill = (0,
|
|
363393
|
+
const clearInputFill = (0, import_react130.useCallback)(() => {
|
|
363382
363394
|
setShouldFillInput(false);
|
|
363383
363395
|
setInputFillText(null);
|
|
363384
363396
|
}, []);
|
|
363385
|
-
(0,
|
|
363397
|
+
(0, import_react130.useEffect)(() => {
|
|
363386
363398
|
if (shouldFillInput && inputFillText) {
|
|
363387
363399
|
buffer.setText(inputFillText);
|
|
363388
363400
|
clearInputFill();
|
|
363389
363401
|
}
|
|
363390
363402
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
363391
|
-
(0,
|
|
363403
|
+
(0, import_react130.useEffect)(() => {
|
|
363392
363404
|
checkWelcomeBack();
|
|
363393
363405
|
}, [checkWelcomeBack]);
|
|
363394
363406
|
return {
|
|
@@ -363409,10 +363421,10 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
363409
363421
|
|
|
363410
363422
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
363411
363423
|
init_esbuild_shims();
|
|
363412
|
-
var
|
|
363424
|
+
var import_react131 = __toESM(require_react(), 1);
|
|
363413
363425
|
init_settings();
|
|
363414
363426
|
function useDialogClose(options2) {
|
|
363415
|
-
const closeAnyOpenDialog = (0,
|
|
363427
|
+
const closeAnyOpenDialog = (0, import_react131.useCallback)(() => {
|
|
363416
363428
|
if (options2.isThemeDialogOpen) {
|
|
363417
363429
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
363418
363430
|
return true;
|
|
@@ -363444,13 +363456,13 @@ __name(useDialogClose, "useDialogClose");
|
|
|
363444
363456
|
|
|
363445
363457
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
363446
363458
|
init_esbuild_shims();
|
|
363447
|
-
var
|
|
363459
|
+
var import_react132 = __toESM(require_react(), 1);
|
|
363448
363460
|
function useSubagentCreateDialog() {
|
|
363449
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
363450
|
-
const openSubagentCreateDialog = (0,
|
|
363461
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react132.useState)(false);
|
|
363462
|
+
const openSubagentCreateDialog = (0, import_react132.useCallback)(() => {
|
|
363451
363463
|
setIsSubagentCreateDialogOpen(true);
|
|
363452
363464
|
}, []);
|
|
363453
|
-
const closeSubagentCreateDialog = (0,
|
|
363465
|
+
const closeSubagentCreateDialog = (0, import_react132.useCallback)(() => {
|
|
363454
363466
|
setIsSubagentCreateDialogOpen(false);
|
|
363455
363467
|
}, []);
|
|
363456
363468
|
return {
|
|
@@ -363463,13 +363475,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
363463
363475
|
|
|
363464
363476
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
363465
363477
|
init_esbuild_shims();
|
|
363466
|
-
var
|
|
363478
|
+
var import_react133 = __toESM(require_react(), 1);
|
|
363467
363479
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
363468
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
363469
|
-
const openAgentsManagerDialog = (0,
|
|
363480
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react133.useState)(false);
|
|
363481
|
+
const openAgentsManagerDialog = (0, import_react133.useCallback)(() => {
|
|
363470
363482
|
setIsAgentsManagerDialogOpen(true);
|
|
363471
363483
|
}, []);
|
|
363472
|
-
const closeAgentsManagerDialog = (0,
|
|
363484
|
+
const closeAgentsManagerDialog = (0, import_react133.useCallback)(() => {
|
|
363473
363485
|
setIsAgentsManagerDialogOpen(false);
|
|
363474
363486
|
}, []);
|
|
363475
363487
|
return {
|
|
@@ -363481,7 +363493,7 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
363481
363493
|
|
|
363482
363494
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
363483
363495
|
init_esbuild_shims();
|
|
363484
|
-
var
|
|
363496
|
+
var import_react134 = __toESM(require_react(), 1);
|
|
363485
363497
|
|
|
363486
363498
|
// packages/cli/src/utils/attentionNotification.ts
|
|
363487
363499
|
init_esbuild_shims();
|
|
@@ -363509,9 +363521,9 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363509
363521
|
streamingState,
|
|
363510
363522
|
elapsedTime
|
|
363511
363523
|
}) => {
|
|
363512
|
-
const awaitingNotificationSentRef = (0,
|
|
363513
|
-
const respondingElapsedRef = (0,
|
|
363514
|
-
(0,
|
|
363524
|
+
const awaitingNotificationSentRef = (0, import_react134.useRef)(false);
|
|
363525
|
+
const respondingElapsedRef = (0, import_react134.useRef)(0);
|
|
363526
|
+
(0, import_react134.useEffect)(() => {
|
|
363515
363527
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
363516
363528
|
notifyTerminalAttention("tool_approval" /* ToolApproval */);
|
|
363517
363529
|
awaitingNotificationSentRef.current = true;
|
|
@@ -363520,7 +363532,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363520
363532
|
awaitingNotificationSentRef.current = false;
|
|
363521
363533
|
}
|
|
363522
363534
|
}, [isFocused, streamingState]);
|
|
363523
|
-
(0,
|
|
363535
|
+
(0, import_react134.useEffect)(() => {
|
|
363524
363536
|
if (streamingState === "responding" /* Responding */) {
|
|
363525
363537
|
respondingElapsedRef.current = elapsedTime;
|
|
363526
363538
|
return;
|
|
@@ -363538,7 +363550,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
363538
363550
|
|
|
363539
363551
|
// packages/cli/src/ui/hooks/useWebSocket.ts
|
|
363540
363552
|
init_esbuild_shims();
|
|
363541
|
-
var
|
|
363553
|
+
var import_react135 = __toESM(require_react(), 1);
|
|
363542
363554
|
|
|
363543
363555
|
// packages/cli/src/config/websocket.ts
|
|
363544
363556
|
init_esbuild_shims();
|
|
@@ -364092,8 +364104,8 @@ function getRdmindSsoId3() {
|
|
|
364092
364104
|
}
|
|
364093
364105
|
__name(getRdmindSsoId3, "getRdmindSsoId");
|
|
364094
364106
|
function useWebSocket({ onReloadCommands, debug: debug2 }) {
|
|
364095
|
-
const wsClientRef = (0,
|
|
364096
|
-
(0,
|
|
364107
|
+
const wsClientRef = (0, import_react135.useRef)(null);
|
|
364108
|
+
(0, import_react135.useEffect)(() => {
|
|
364097
364109
|
const wsRuntimeConfig = loadWebSocketRuntimeConfig(debug2);
|
|
364098
364110
|
if (!wsRuntimeConfig.enabled) {
|
|
364099
364111
|
if (debug2) {
|
|
@@ -364155,22 +364167,22 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364155
364167
|
const { settings, config, initializationResult } = props;
|
|
364156
364168
|
const historyManager = useHistory();
|
|
364157
364169
|
useMemoryMonitor(historyManager);
|
|
364158
|
-
const [corgiMode, setCorgiMode] = (0,
|
|
364159
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
364160
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
364161
|
-
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)(
|
|
364162
364174
|
initializationResult.themeError
|
|
364163
364175
|
);
|
|
364164
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
364165
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
364166
|
-
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)(
|
|
364167
364179
|
initializationResult.geminiMdFileCount
|
|
364168
364180
|
);
|
|
364169
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
364170
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
364171
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
364172
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
364173
|
-
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)(
|
|
364174
364186
|
config.isTrustedFolder()
|
|
364175
364187
|
);
|
|
364176
364188
|
const extensions = config.getExtensions();
|
|
@@ -364185,38 +364197,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364185
364197
|
historyManager.addItem,
|
|
364186
364198
|
config.getWorkingDir()
|
|
364187
364199
|
);
|
|
364188
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
364189
|
-
const openPermissionsDialog = (0,
|
|
364200
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react136.useState)(false);
|
|
364201
|
+
const openPermissionsDialog = (0, import_react136.useCallback)(
|
|
364190
364202
|
() => setPermissionsDialogOpen(true),
|
|
364191
364203
|
[]
|
|
364192
364204
|
);
|
|
364193
|
-
const closePermissionsDialog = (0,
|
|
364205
|
+
const closePermissionsDialog = (0, import_react136.useCallback)(
|
|
364194
364206
|
() => setPermissionsDialogOpen(false),
|
|
364195
364207
|
[]
|
|
364196
364208
|
);
|
|
364197
|
-
const getEffectiveModel2 = (0,
|
|
364209
|
+
const getEffectiveModel2 = (0, import_react136.useCallback)(() => {
|
|
364198
364210
|
if (config.isInFallbackMode()) {
|
|
364199
364211
|
return DEFAULT_GEMINI_FLASH_MODEL;
|
|
364200
364212
|
}
|
|
364201
364213
|
return config.getModel();
|
|
364202
364214
|
}, [config]);
|
|
364203
|
-
const [currentModel, setCurrentModel] = (0,
|
|
364204
|
-
const [userTier] = (0,
|
|
364205
|
-
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);
|
|
364206
364218
|
const logger6 = useLogger(config.storage);
|
|
364207
|
-
const [userMessages, setUserMessages] = (0,
|
|
364219
|
+
const [userMessages, setUserMessages] = (0, import_react136.useState)([]);
|
|
364208
364220
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
364209
364221
|
const { stdin, setRawMode } = use_stdin_default();
|
|
364210
364222
|
const { stdout } = use_stdout_default();
|
|
364211
364223
|
const { stats: sessionStats } = useSessionStats();
|
|
364212
364224
|
const branchName = useGitBranchName(config.getTargetDir());
|
|
364213
|
-
const mainControlsRef = (0,
|
|
364214
|
-
const originalTitleRef = (0,
|
|
364225
|
+
const mainControlsRef = (0, import_react136.useRef)(null);
|
|
364226
|
+
const originalTitleRef = (0, import_react136.useRef)(
|
|
364215
364227
|
computeWindowTitle(basename16(config.getTargetDir()))
|
|
364216
364228
|
);
|
|
364217
|
-
const lastTitleRef = (0,
|
|
364229
|
+
const lastTitleRef = (0, import_react136.useRef)(null);
|
|
364218
364230
|
const staticExtraHeight = 3;
|
|
364219
|
-
(0,
|
|
364231
|
+
(0, import_react136.useEffect)(() => {
|
|
364220
364232
|
(async () => {
|
|
364221
364233
|
await config.initialize();
|
|
364222
364234
|
setConfigInitialized(true);
|
|
@@ -364226,11 +364238,11 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364226
364238
|
await ideClient.disconnect();
|
|
364227
364239
|
});
|
|
364228
364240
|
}, [config]);
|
|
364229
|
-
(0,
|
|
364241
|
+
(0, import_react136.useEffect)(
|
|
364230
364242
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
364231
364243
|
[historyManager.addItem]
|
|
364232
364244
|
);
|
|
364233
|
-
(0,
|
|
364245
|
+
(0, import_react136.useEffect)(() => {
|
|
364234
364246
|
const checkModelChange = /* @__PURE__ */ __name(() => {
|
|
364235
364247
|
const effectiveModel = getEffectiveModel2();
|
|
364236
364248
|
if (effectiveModel !== currentModel) {
|
|
@@ -364246,7 +364258,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364246
364258
|
handleNewMessage,
|
|
364247
364259
|
clearConsoleMessages: clearConsoleMessagesState
|
|
364248
364260
|
} = useConsoleMessages();
|
|
364249
|
-
(0,
|
|
364261
|
+
(0, import_react136.useEffect)(() => {
|
|
364250
364262
|
const consolePatcher = new ConsolePatcher({
|
|
364251
364263
|
onNewMessage: handleNewMessage,
|
|
364252
364264
|
debugMode: config.getDebugMode()
|
|
@@ -364254,13 +364266,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364254
364266
|
consolePatcher.patch();
|
|
364255
364267
|
registerCleanup(consolePatcher.cleanup);
|
|
364256
364268
|
}, [handleNewMessage, config]);
|
|
364257
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
364269
|
+
const { inputWidth, suggestionsWidth } = (0, import_react136.useMemo)(() => {
|
|
364258
364270
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
364259
364271
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
364260
364272
|
}, [terminalWidth]);
|
|
364261
364273
|
const mainAreaWidth = Math.floor(terminalWidth * 0.9);
|
|
364262
364274
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
364263
|
-
const isValidPath = (0,
|
|
364275
|
+
const isValidPath = (0, import_react136.useCallback)((filePath) => {
|
|
364264
364276
|
try {
|
|
364265
364277
|
return fs99.existsSync(filePath) && fs99.statSync(filePath).isFile();
|
|
364266
364278
|
} catch (_e) {
|
|
@@ -364275,7 +364287,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364275
364287
|
isValidPath,
|
|
364276
364288
|
shellModeActive
|
|
364277
364289
|
});
|
|
364278
|
-
(0,
|
|
364290
|
+
(0, import_react136.useEffect)(() => {
|
|
364279
364291
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
364280
364292
|
const pastMessagesRaw = await logger6?.getPreviousUserMessages() || [];
|
|
364281
364293
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -364298,7 +364310,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364298
364310
|
}, "fetchUserMessages");
|
|
364299
364311
|
fetchUserMessages();
|
|
364300
364312
|
}, [historyManager.history, logger6]);
|
|
364301
|
-
const refreshStatic = (0,
|
|
364313
|
+
const refreshStatic = (0, import_react136.useCallback)(() => {
|
|
364302
364314
|
stdout.write(base_exports.clearTerminal);
|
|
364303
364315
|
setHistoryRemountKey((prev) => prev + 1);
|
|
364304
364316
|
}, [setHistoryRemountKey, stdout]);
|
|
@@ -364330,7 +364342,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364330
364342
|
openAuthDialog,
|
|
364331
364343
|
cancelAuthentication
|
|
364332
364344
|
} = useAuthCommand(settings, config, historyManager.addItem);
|
|
364333
|
-
(0,
|
|
364345
|
+
(0, import_react136.useEffect)(() => {
|
|
364334
364346
|
if (!shouldTriggerAutoSSOAuth(settings)) {
|
|
364335
364347
|
return;
|
|
364336
364348
|
}
|
|
@@ -364509,17 +364521,17 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364509
364521
|
setAuthState,
|
|
364510
364522
|
setModelSwitchedFromQuotaError
|
|
364511
364523
|
});
|
|
364512
|
-
const handleQwenAuthTimeout = (0,
|
|
364524
|
+
const handleQwenAuthTimeout = (0, import_react136.useCallback)(() => {
|
|
364513
364525
|
onAuthError("Qwen OAuth authentication timed out. Please try again.");
|
|
364514
364526
|
cancelAuthentication();
|
|
364515
364527
|
setAuthState("updating" /* Updating */);
|
|
364516
364528
|
}, [onAuthError, cancelAuthentication, setAuthState]);
|
|
364517
|
-
const handleQwenAuthCancel = (0,
|
|
364529
|
+
const handleQwenAuthCancel = (0, import_react136.useCallback)(() => {
|
|
364518
364530
|
onAuthError("Qwen OAuth authentication cancelled.");
|
|
364519
364531
|
cancelAuthentication();
|
|
364520
364532
|
setAuthState("updating" /* Updating */);
|
|
364521
364533
|
}, [onAuthError, cancelAuthentication, setAuthState]);
|
|
364522
|
-
(0,
|
|
364534
|
+
(0, import_react136.useEffect)(() => {
|
|
364523
364535
|
if (settings.merged.security?.auth?.enforcedType && settings.merged.security?.auth.selectedType && settings.merged.security?.auth.enforcedType !== settings.merged.security?.auth.selectedType) {
|
|
364524
364536
|
onAuthError(
|
|
364525
364537
|
`Authentication is enforced to be ${settings.merged.security?.auth.enforcedType}, but you are currently using ${settings.merged.security?.auth.selectedType}.`
|
|
@@ -364538,7 +364550,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364538
364550
|
settings.merged.security?.auth?.useExternal,
|
|
364539
364551
|
onAuthError
|
|
364540
364552
|
]);
|
|
364541
|
-
const [editorError, setEditorError] = (0,
|
|
364553
|
+
const [editorError, setEditorError] = (0, import_react136.useState)(null);
|
|
364542
364554
|
const {
|
|
364543
364555
|
isEditorDialogOpen,
|
|
364544
364556
|
openEditorDialog,
|
|
@@ -364565,9 +364577,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364565
364577
|
openAgentsManagerDialog,
|
|
364566
364578
|
closeAgentsManagerDialog
|
|
364567
364579
|
} = useAgentsManagerDialog();
|
|
364568
|
-
const [isVisionSwitchDialogOpen, setIsVisionSwitchDialogOpen] = (0,
|
|
364569
|
-
const [visionSwitchResolver, setVisionSwitchResolver] = (0,
|
|
364570
|
-
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)(
|
|
364571
364583
|
() => ({
|
|
364572
364584
|
openAuthDialog,
|
|
364573
364585
|
openThemeDialog,
|
|
@@ -364635,14 +364647,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364635
364647
|
onReloadCommands: reloadCommands,
|
|
364636
364648
|
debug: config.getDebugMode()
|
|
364637
364649
|
});
|
|
364638
|
-
const handleVisionSwitchRequired = (0,
|
|
364650
|
+
const handleVisionSwitchRequired = (0, import_react136.useCallback)(
|
|
364639
364651
|
async (_query) => new Promise((resolve26, reject) => {
|
|
364640
364652
|
setVisionSwitchResolver({ resolve: resolve26, reject });
|
|
364641
364653
|
setIsVisionSwitchDialogOpen(true);
|
|
364642
364654
|
}),
|
|
364643
364655
|
[]
|
|
364644
364656
|
);
|
|
364645
|
-
const handleVisionSwitchSelect = (0,
|
|
364657
|
+
const handleVisionSwitchSelect = (0, import_react136.useCallback)(
|
|
364646
364658
|
(outcome) => {
|
|
364647
364659
|
setIsVisionSwitchDialogOpen(false);
|
|
364648
364660
|
if (visionSwitchResolver) {
|
|
@@ -364653,10 +364665,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364653
364665
|
},
|
|
364654
364666
|
[visionSwitchResolver]
|
|
364655
364667
|
);
|
|
364656
|
-
const onDebugMessage = (0,
|
|
364668
|
+
const onDebugMessage = (0, import_react136.useCallback)((message) => {
|
|
364657
364669
|
console.debug(message);
|
|
364658
364670
|
}, []);
|
|
364659
|
-
const performMemoryRefresh = (0,
|
|
364671
|
+
const performMemoryRefresh = (0, import_react136.useCallback)(async () => {
|
|
364660
364672
|
historyManager.addItem(
|
|
364661
364673
|
{
|
|
364662
364674
|
type: "info" /* INFO */,
|
|
@@ -364707,7 +364719,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364707
364719
|
console.error("Error refreshing memory:", error);
|
|
364708
364720
|
}
|
|
364709
364721
|
}, [config, historyManager, settings.merged]);
|
|
364710
|
-
const cancelHandlerRef = (0,
|
|
364722
|
+
const cancelHandlerRef = (0, import_react136.useRef)(() => {
|
|
364711
364723
|
});
|
|
364712
364724
|
const {
|
|
364713
364725
|
streamingState,
|
|
@@ -364754,7 +364766,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364754
364766
|
streamingState,
|
|
364755
364767
|
submitQuery
|
|
364756
364768
|
});
|
|
364757
|
-
const handleFinalSubmit = (0,
|
|
364769
|
+
const handleFinalSubmit = (0, import_react136.useCallback)(
|
|
364758
364770
|
(submittedValue) => {
|
|
364759
364771
|
addMessage(submittedValue);
|
|
364760
364772
|
},
|
|
@@ -364767,7 +364779,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
364767
364779
|
handleWelcomeBackSelection,
|
|
364768
364780
|
handleWelcomeBackClose
|
|
364769
364781
|
} = useWelcomeBack(config, handleFinalSubmit, buffer, settings.merged);
|
|
364770
|
-
cancelHandlerRef.current = (0,
|
|
364782
|
+
cancelHandlerRef.current = (0, import_react136.useCallback)(() => {
|
|
364771
364783
|
const pendingHistoryItems2 = [
|
|
364772
364784
|
...pendingSlashCommandHistoryItems,
|
|
364773
364785
|
...pendingGeminiHistoryItems
|
|
@@ -364796,7 +364808,7 @@ ${queuedText}` : queuedText;
|
|
|
364796
364808
|
pendingSlashCommandHistoryItems,
|
|
364797
364809
|
pendingGeminiHistoryItems
|
|
364798
364810
|
]);
|
|
364799
|
-
const handleClearScreen = (0,
|
|
364811
|
+
const handleClearScreen = (0, import_react136.useCallback)(() => {
|
|
364800
364812
|
historyManager.clearItems();
|
|
364801
364813
|
clearConsoleMessagesState();
|
|
364802
364814
|
console.clear();
|
|
@@ -364804,8 +364816,8 @@ ${queuedText}` : queuedText;
|
|
|
364804
364816
|
}, [historyManager, clearConsoleMessagesState, refreshStatic]);
|
|
364805
364817
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
364806
364818
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */) && !proQuotaRequest;
|
|
364807
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
364808
|
-
(0,
|
|
364819
|
+
const [controlsHeight, setControlsHeight] = (0, import_react136.useState)(0);
|
|
364820
|
+
(0, import_react136.useLayoutEffect)(() => {
|
|
364809
364821
|
if (mainControlsRef.current) {
|
|
364810
364822
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
364811
364823
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -364828,14 +364840,14 @@ ${queuedText}` : queuedText;
|
|
|
364828
364840
|
});
|
|
364829
364841
|
const isFocused = useFocus();
|
|
364830
364842
|
useBracketedPaste();
|
|
364831
|
-
const contextFileNames = (0,
|
|
364843
|
+
const contextFileNames = (0, import_react136.useMemo)(() => {
|
|
364832
364844
|
const fromSettings = settings.merged.context?.fileName;
|
|
364833
364845
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
364834
364846
|
}, [settings.merged.context?.fileName]);
|
|
364835
|
-
const initialPrompt = (0,
|
|
364836
|
-
const initialPromptSubmitted = (0,
|
|
364847
|
+
const initialPrompt = (0, import_react136.useMemo)(() => config.getQuestion(), [config]);
|
|
364848
|
+
const initialPromptSubmitted = (0, import_react136.useRef)(false);
|
|
364837
364849
|
const geminiClient = config.getGeminiClient();
|
|
364838
|
-
(0,
|
|
364850
|
+
(0, import_react136.useEffect)(() => {
|
|
364839
364851
|
if (activePtyId) {
|
|
364840
364852
|
ShellExecutionService.resizePty(
|
|
364841
364853
|
activePtyId,
|
|
@@ -364844,7 +364856,7 @@ ${queuedText}` : queuedText;
|
|
|
364844
364856
|
);
|
|
364845
364857
|
}
|
|
364846
364858
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
364847
|
-
(0,
|
|
364859
|
+
(0, import_react136.useEffect)(() => {
|
|
364848
364860
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && !isVisionSwitchDialogOpen && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
364849
364861
|
handleFinalSubmit(initialPrompt);
|
|
364850
364862
|
initialPromptSubmitted.current = true;
|
|
@@ -364862,9 +364874,9 @@ ${queuedText}` : queuedText;
|
|
|
364862
364874
|
welcomeBackChoice,
|
|
364863
364875
|
geminiClient
|
|
364864
364876
|
]);
|
|
364865
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
364866
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
364867
|
-
(0,
|
|
364877
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react136.useState)(false);
|
|
364878
|
+
const [currentIDE, setCurrentIDE] = (0, import_react136.useState)(null);
|
|
364879
|
+
(0, import_react136.useEffect)(() => {
|
|
364868
364880
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
364869
364881
|
const ideClient = await IdeClient.getInstance();
|
|
364870
364882
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -364875,28 +364887,28 @@ ${queuedText}` : queuedText;
|
|
|
364875
364887
|
const shouldShowIdePrompt = Boolean(
|
|
364876
364888
|
currentIDE && !config.getIdeMode() && !settings.merged.ide?.hasSeenNudge && !idePromptAnswered
|
|
364877
364889
|
);
|
|
364878
|
-
const [showErrorDetails, setShowErrorDetails] = (0,
|
|
364879
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
364880
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
364881
|
-
const ctrlCTimerRef = (0,
|
|
364882
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
364883
|
-
const ctrlDTimerRef = (0,
|
|
364884
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
364885
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
364886
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
364887
|
-
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);
|
|
364888
364900
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings, setIsTrustedFolder);
|
|
364889
364901
|
const {
|
|
364890
364902
|
needsRestart: ideNeedsRestart,
|
|
364891
364903
|
restartReason: ideTrustRestartReason
|
|
364892
364904
|
} = useIdeTrustListener();
|
|
364893
|
-
const isInitialMount = (0,
|
|
364894
|
-
(0,
|
|
364905
|
+
const isInitialMount = (0, import_react136.useRef)(true);
|
|
364906
|
+
(0, import_react136.useEffect)(() => {
|
|
364895
364907
|
if (ideNeedsRestart) {
|
|
364896
364908
|
setShowIdeRestartPrompt(true);
|
|
364897
364909
|
}
|
|
364898
364910
|
}, [ideNeedsRestart]);
|
|
364899
|
-
(0,
|
|
364911
|
+
(0, import_react136.useEffect)(() => {
|
|
364900
364912
|
if (isInitialMount.current) {
|
|
364901
364913
|
isInitialMount.current = false;
|
|
364902
364914
|
return;
|
|
@@ -364908,12 +364920,12 @@ ${queuedText}` : queuedText;
|
|
|
364908
364920
|
clearTimeout(handler);
|
|
364909
364921
|
};
|
|
364910
364922
|
}, [terminalWidth, refreshStatic]);
|
|
364911
|
-
(0,
|
|
364923
|
+
(0, import_react136.useEffect)(() => {
|
|
364912
364924
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
364913
364925
|
setIdeContextState(ideContextStore.get());
|
|
364914
364926
|
return unsubscribe;
|
|
364915
364927
|
}, []);
|
|
364916
|
-
(0,
|
|
364928
|
+
(0, import_react136.useEffect)(() => {
|
|
364917
364929
|
const openDebugConsole = /* @__PURE__ */ __name(() => {
|
|
364918
364930
|
setShowErrorDetails(true);
|
|
364919
364931
|
setConstrainHeight(false);
|
|
@@ -364932,10 +364944,10 @@ ${queuedText}` : queuedText;
|
|
|
364932
364944
|
appEvents.off("log-error" /* LogError */, logErrorHandler);
|
|
364933
364945
|
};
|
|
364934
364946
|
}, [handleNewMessage]);
|
|
364935
|
-
const handleEscapePromptChange = (0,
|
|
364947
|
+
const handleEscapePromptChange = (0, import_react136.useCallback)((showPrompt) => {
|
|
364936
364948
|
setShowEscapePrompt(showPrompt);
|
|
364937
364949
|
}, []);
|
|
364938
|
-
const handleIdePromptComplete = (0,
|
|
364950
|
+
const handleIdePromptComplete = (0, import_react136.useCallback)(
|
|
364939
364951
|
(result) => {
|
|
364940
364952
|
if (result.userSelection === "yes") {
|
|
364941
364953
|
handleSlashCommand2("/ide install");
|
|
@@ -364973,7 +364985,7 @@ ${queuedText}` : queuedText;
|
|
|
364973
364985
|
handleWelcomeBackClose,
|
|
364974
364986
|
quitConfirmationRequest
|
|
364975
364987
|
});
|
|
364976
|
-
const handleExit = (0,
|
|
364988
|
+
const handleExit = (0, import_react136.useCallback)(
|
|
364977
364989
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
364978
364990
|
if (pressedOnce) {
|
|
364979
364991
|
if (timerRef.current) {
|
|
@@ -365016,7 +365028,7 @@ ${queuedText}` : queuedText;
|
|
|
365016
365028
|
buffer
|
|
365017
365029
|
]
|
|
365018
365030
|
);
|
|
365019
|
-
const handleGlobalKeypress = (0,
|
|
365031
|
+
const handleGlobalKeypress = (0, import_react136.useCallback)(
|
|
365020
365032
|
(key) => {
|
|
365021
365033
|
if (settings.merged.general?.debugKeystrokeLogging) {
|
|
365022
365034
|
console.log("[DEBUG] Keystroke:", JSON.stringify(key));
|
|
@@ -365089,7 +365101,7 @@ ${queuedText}` : queuedText;
|
|
|
365089
365101
|
]
|
|
365090
365102
|
);
|
|
365091
365103
|
useKeypress(handleGlobalKeypress, { isActive: true });
|
|
365092
|
-
(0,
|
|
365104
|
+
(0, import_react136.useEffect)(() => {
|
|
365093
365105
|
if (!settings.merged.ui?.showStatusInTitle || settings.merged.ui?.hideWindowTitle)
|
|
365094
365106
|
return;
|
|
365095
365107
|
let title;
|
|
@@ -365111,23 +365123,23 @@ ${queuedText}` : queuedText;
|
|
|
365111
365123
|
settings.merged.ui?.hideWindowTitle,
|
|
365112
365124
|
stdout
|
|
365113
365125
|
]);
|
|
365114
|
-
const filteredConsoleMessages = (0,
|
|
365126
|
+
const filteredConsoleMessages = (0, import_react136.useMemo)(() => {
|
|
365115
365127
|
if (config.getDebugMode()) {
|
|
365116
365128
|
return consoleMessages;
|
|
365117
365129
|
}
|
|
365118
365130
|
return consoleMessages.filter((msg) => msg.type !== "debug");
|
|
365119
365131
|
}, [consoleMessages, config]);
|
|
365120
|
-
const errorCount = (0,
|
|
365132
|
+
const errorCount = (0, import_react136.useMemo)(
|
|
365121
365133
|
() => filteredConsoleMessages.filter((msg) => msg.type === "error").reduce((total, msg) => total + msg.count, 0),
|
|
365122
365134
|
[filteredConsoleMessages]
|
|
365123
365135
|
);
|
|
365124
365136
|
const nightly = props.version.includes("nightly");
|
|
365125
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;
|
|
365126
|
-
const pendingHistoryItems = (0,
|
|
365138
|
+
const pendingHistoryItems = (0, import_react136.useMemo)(
|
|
365127
365139
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
365128
365140
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
365129
365141
|
);
|
|
365130
|
-
const uiState = (0,
|
|
365142
|
+
const uiState = (0, import_react136.useMemo)(
|
|
365131
365143
|
() => ({
|
|
365132
365144
|
history: historyManager.history,
|
|
365133
365145
|
historyManager,
|
|
@@ -365326,7 +365338,7 @@ ${queuedText}` : queuedText;
|
|
|
365326
365338
|
isAgentsManagerDialogOpen
|
|
365327
365339
|
]
|
|
365328
365340
|
);
|
|
365329
|
-
const uiActions = (0,
|
|
365341
|
+
const uiActions = (0, import_react136.useMemo)(
|
|
365330
365342
|
() => ({
|
|
365331
365343
|
handleThemeSelect,
|
|
365332
365344
|
handleThemeHighlight,
|
|
@@ -366587,9 +366599,9 @@ init_core2();
|
|
|
366587
366599
|
|
|
366588
366600
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
366589
366601
|
init_esbuild_shims();
|
|
366590
|
-
var
|
|
366602
|
+
var import_react137 = __toESM(require_react(), 1);
|
|
366591
366603
|
function useKittyKeyboardProtocol() {
|
|
366592
|
-
const [status] = (0,
|
|
366604
|
+
const [status] = (0, import_react137.useState)({
|
|
366593
366605
|
supported: isKittyProtocolSupported(),
|
|
366594
366606
|
enabled: isKittyProtocolEnabled(),
|
|
366595
366607
|
checking: false
|
|
@@ -368450,7 +368462,7 @@ async function startInteractiveUI(config, settings, startupWarnings, workspaceRo
|
|
|
368450
368462
|
) });
|
|
368451
368463
|
}, "AppWrapper");
|
|
368452
368464
|
const instance = render_default(
|
|
368453
|
-
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, {}),
|
|
368454
368466
|
{
|
|
368455
368467
|
exitOnCtrlC: false,
|
|
368456
368468
|
isScreenReaderEnabled: config.getScreenReader()
|