@google/gemini-cli 0.1.17 → 0.1.18-nightly.250811.2865a527
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +199 -132
- package/dist/google-gemini-cli-0.1.18.tgz +0 -0
- package/dist/package.json +6 -3
- package/dist/src/acp/acpPeer.js +72 -64
- package/dist/src/acp/acpPeer.js.map +1 -1
- package/dist/src/commands/mcp/add.d.ts +7 -0
- package/dist/src/commands/mcp/add.js +155 -0
- package/dist/src/commands/mcp/add.js.map +1 -0
- package/dist/src/commands/mcp/list.d.ts +8 -0
- package/dist/src/commands/mcp/list.js +110 -0
- package/dist/src/commands/mcp/list.js.map +1 -0
- package/dist/src/commands/mcp/remove.d.ts +7 -0
- package/dist/src/commands/mcp/remove.js +44 -0
- package/dist/src/commands/mcp/remove.js.map +1 -0
- package/dist/src/commands/mcp.d.ts +7 -0
- package/dist/src/commands/mcp.js +23 -0
- package/dist/src/commands/mcp.js.map +1 -0
- package/dist/src/config/config.d.ts +1 -1
- package/dist/src/config/config.js +77 -46
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/keyBindings.d.ts +66 -0
- package/dist/src/config/keyBindings.js +136 -0
- package/dist/src/config/keyBindings.js.map +1 -0
- package/dist/src/config/settings.d.ts +3 -48
- package/dist/src/config/settings.js +23 -3
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/config/settingsSchema.d.ts +497 -0
- package/dist/src/config/settingsSchema.js +470 -0
- package/dist/src/config/settingsSchema.js.map +1 -0
- package/dist/src/gemini.js +5 -28
- package/dist/src/gemini.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +1 -1
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/generated/git-commit.js.map +1 -1
- package/dist/src/nonInteractiveCli.js +20 -12
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +3 -2
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/ui/App.js +103 -38
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/IdeIntegrationNudge.d.ts +13 -0
- package/dist/src/ui/IdeIntegrationNudge.js +31 -0
- package/dist/src/ui/IdeIntegrationNudge.js.map +1 -0
- package/dist/src/ui/commands/chatCommand.js +15 -0
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.js +21 -1
- package/dist/src/ui/commands/directoryCommand.js.map +1 -1
- package/dist/src/ui/commands/ideCommand.js +103 -35
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +3 -1
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/settingsCommand.d.ts +7 -0
- package/dist/src/ui/commands/settingsCommand.js +16 -0
- package/dist/src/ui/commands/settingsCommand.js.map +1 -0
- package/dist/src/ui/commands/setupGithubCommand.js +57 -18
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -1
- package/dist/src/ui/commands/types.d.ts +14 -2
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/components/AsciiArt.d.ts +1 -0
- package/dist/src/ui/components/AsciiArt.js +10 -0
- package/dist/src/ui/components/AsciiArt.js.map +1 -1
- package/dist/src/ui/components/AuthInProgress.js +3 -3
- package/dist/src/ui/components/AuthInProgress.js.map +1 -1
- package/dist/src/ui/components/ContextSummaryDisplay.js +21 -24
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/ContextUsageDisplay.d.ts +9 -0
- package/dist/src/ui/components/ContextUsageDisplay.js +14 -0
- package/dist/src/ui/components/ContextUsageDisplay.js.map +1 -0
- package/dist/src/ui/components/FolderTrustDialog.d.ts +16 -0
- package/dist/src/ui/components/FolderTrustDialog.js +38 -0
- package/dist/src/ui/components/FolderTrustDialog.js.map +1 -0
- package/dist/src/ui/components/Footer.js +14 -5
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.d.ts +0 -1
- package/dist/src/ui/components/Header.js +13 -5
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +1 -0
- package/dist/src/ui/components/InputPrompt.js +90 -34
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadingIndicator.js +10 -5
- package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
- package/dist/src/ui/components/SettingsDialog.d.ts +14 -0
- package/dist/src/ui/components/SettingsDialog.js +247 -0
- package/dist/src/ui/components/SettingsDialog.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +1 -1
- package/dist/src/ui/components/SuggestionsDisplay.js.map +1 -1
- package/dist/src/ui/components/ThemeDialog.js +4 -15
- package/dist/src/ui/components/ThemeDialog.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +29 -9
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/contexts/SettingsContext.d.ts +9 -0
- package/dist/src/ui/contexts/SettingsContext.js +15 -0
- package/dist/src/ui/contexts/SettingsContext.js.map +1 -0
- package/dist/src/ui/hooks/atCommandProcessor.js +7 -4
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -2
- package/dist/src/ui/hooks/slashCommandProcessor.js +36 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAtCompletion.d.ts +23 -0
- package/dist/src/ui/hooks/useAtCompletion.js +180 -0
- package/dist/src/ui/hooks/useAtCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useCommandCompletion.d.ts +6 -1
- package/dist/src/ui/hooks/useCommandCompletion.js +95 -383
- package/dist/src/ui/hooks/useCommandCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useFolderTrust.d.ts +11 -0
- package/dist/src/ui/hooks/useFolderTrust.js +22 -0
- package/dist/src/ui/hooks/useFolderTrust.js.map +1 -0
- package/dist/src/ui/hooks/useGeminiStream.d.ts +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +3 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +2 -5
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.d.ts +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +18 -16
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +4 -2
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useSettingsCommand.d.ts +10 -0
- package/dist/src/ui/hooks/useSettingsCommand.js +21 -0
- package/dist/src/ui/hooks/useSettingsCommand.js.map +1 -0
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +20 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +135 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
- package/dist/src/ui/hooks/vim.js +13 -4
- package/dist/src/ui/hooks/vim.js.map +1 -1
- package/dist/src/ui/keyMatchers.d.ts +26 -0
- package/dist/src/ui/keyMatchers.js +68 -0
- package/dist/src/ui/keyMatchers.js.map +1 -0
- package/dist/src/ui/semantic-colors.d.ts +7 -0
- package/dist/src/ui/semantic-colors.js +24 -0
- package/dist/src/ui/semantic-colors.js.map +1 -0
- package/dist/src/ui/themes/ansi-light.js +2 -1
- package/dist/src/ui/themes/ansi-light.js.map +1 -1
- package/dist/src/ui/themes/ansi.js +2 -1
- package/dist/src/ui/themes/ansi.js.map +1 -1
- package/dist/src/ui/themes/atom-one-dark.js +2 -1
- package/dist/src/ui/themes/atom-one-dark.js.map +1 -1
- package/dist/src/ui/themes/ayu-light.js +2 -1
- package/dist/src/ui/themes/ayu-light.js.map +1 -1
- package/dist/src/ui/themes/ayu.js +2 -1
- package/dist/src/ui/themes/ayu.js.map +1 -1
- package/dist/src/ui/themes/default-light.js +2 -1
- package/dist/src/ui/themes/default-light.js.map +1 -1
- package/dist/src/ui/themes/default.js +2 -1
- package/dist/src/ui/themes/default.js.map +1 -1
- package/dist/src/ui/themes/dracula.js +2 -1
- package/dist/src/ui/themes/dracula.js.map +1 -1
- package/dist/src/ui/themes/github-dark.js +2 -1
- package/dist/src/ui/themes/github-dark.js.map +1 -1
- package/dist/src/ui/themes/github-light.js +2 -1
- package/dist/src/ui/themes/github-light.js.map +1 -1
- package/dist/src/ui/themes/googlecode.js +2 -1
- package/dist/src/ui/themes/googlecode.js.map +1 -1
- package/dist/src/ui/themes/no-color.js +30 -1
- package/dist/src/ui/themes/no-color.js.map +1 -1
- package/dist/src/ui/themes/semantic-tokens.d.ts +37 -0
- package/dist/src/ui/themes/semantic-tokens.js +94 -0
- package/dist/src/ui/themes/semantic-tokens.js.map +1 -0
- package/dist/src/ui/themes/shades-of-purple.js +2 -1
- package/dist/src/ui/themes/shades-of-purple.js.map +1 -1
- package/dist/src/ui/themes/theme-manager.d.ts +6 -0
- package/dist/src/ui/themes/theme-manager.js +7 -0
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +45 -2
- package/dist/src/ui/themes/theme.js +92 -107
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/themes/xcode.js +2 -1
- package/dist/src/ui/themes/xcode.js.map +1 -1
- package/dist/src/ui/types.d.ts +1 -1
- package/dist/src/ui/utils/CodeColorizer.d.ts +2 -1
- package/dist/src/ui/utils/CodeColorizer.js +4 -3
- package/dist/src/ui/utils/CodeColorizer.js.map +1 -1
- package/dist/src/ui/utils/ConsolePatcher.d.ts +3 -1
- package/dist/src/ui/utils/ConsolePatcher.js +18 -8
- package/dist/src/ui/utils/ConsolePatcher.js.map +1 -1
- package/dist/src/ui/utils/MarkdownDisplay.js +4 -2
- package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
- package/dist/src/ui/utils/commandUtils.d.ts +1 -0
- package/dist/src/ui/utils/commandUtils.js +22 -1
- package/dist/src/ui/utils/commandUtils.js.map +1 -1
- package/dist/src/ui/utils/isNarrowWidth.d.ts +6 -0
- package/dist/src/ui/utils/isNarrowWidth.js +9 -0
- package/dist/src/ui/utils/isNarrowWidth.js.map +1 -0
- package/dist/src/utils/cleanup.d.ts +2 -2
- package/dist/src/utils/cleanup.js +2 -2
- package/dist/src/utils/cleanup.js.map +1 -1
- package/dist/src/utils/dialogScopeUtils.d.ts +31 -0
- package/dist/src/utils/dialogScopeUtils.js +48 -0
- package/dist/src/utils/dialogScopeUtils.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +21 -1
- package/dist/src/utils/gitUtils.js +70 -3
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/resolvePath.d.ts +6 -0
- package/dist/src/utils/resolvePath.js +21 -0
- package/dist/src/utils/resolvePath.js.map +1 -0
- package/dist/src/utils/sandbox.js +426 -405
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/settingsUtils.d.ts +126 -0
- package/dist/src/utils/settingsUtils.js +327 -0
- package/dist/src/utils/settingsUtils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -3
- package/dist/google-gemini-cli-0.1.16.tgz +0 -0
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js +0 -12
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +0 -1
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Text } from 'ink';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
3
|
import { Colors } from '../colors.js';
|
|
4
|
+
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
|
5
|
+
import { isNarrowWidth } from '../utils/isNarrowWidth.js';
|
|
4
6
|
export const ContextSummaryDisplay = ({ geminiMdFileCount, contextFileNames, mcpServers, blockedMcpServers, showToolDescriptions, ideContext, }) => {
|
|
7
|
+
const { columns: terminalWidth } = useTerminalSize();
|
|
8
|
+
const isNarrow = isNarrowWidth(terminalWidth);
|
|
5
9
|
const mcpServerCount = Object.keys(mcpServers || {}).length;
|
|
6
10
|
const blockedMcpServerCount = blockedMcpServers?.length || 0;
|
|
7
11
|
const openFileCount = ideContext?.workspaceState?.openFiles?.length ?? 0;
|
|
@@ -40,29 +44,22 @@ export const ContextSummaryDisplay = ({ geminiMdFileCount, contextFileNames, mcp
|
|
|
40
44
|
}
|
|
41
45
|
parts.push(blockedText);
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
if (mcpText) {
|
|
54
|
-
summaryParts.push(mcpText);
|
|
55
|
-
}
|
|
56
|
-
summaryText += summaryParts.join(' | ');
|
|
57
|
-
// Add ctrl+t hint when MCP servers are available
|
|
58
|
-
if (mcpServers && Object.keys(mcpServers).length > 0) {
|
|
59
|
-
if (showToolDescriptions) {
|
|
60
|
-
summaryText += ' (ctrl+t to toggle)';
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
summaryText += ' (ctrl+t to view)';
|
|
47
|
+
let text = parts.join(', ');
|
|
48
|
+
// Add ctrl+t hint when MCP servers are available
|
|
49
|
+
if (mcpServers && Object.keys(mcpServers).length > 0) {
|
|
50
|
+
if (showToolDescriptions) {
|
|
51
|
+
text += ' (ctrl+t to toggle)';
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
text += ' (ctrl+t to view)';
|
|
55
|
+
}
|
|
64
56
|
}
|
|
57
|
+
return text;
|
|
58
|
+
})();
|
|
59
|
+
const summaryParts = [openFilesText, geminiMdText, mcpText].filter(Boolean);
|
|
60
|
+
if (isNarrow) {
|
|
61
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: Colors.Gray, children: "Using:" }), summaryParts.map((part, index) => (_jsxs(Text, { color: Colors.Gray, children: [' ', "- ", part] }, index)))] }));
|
|
65
62
|
}
|
|
66
|
-
return _jsx(Text, { color: Colors.Gray, children:
|
|
63
|
+
return (_jsx(Box, { children: _jsxs(Text, { color: Colors.Gray, children: ["Using: ", summaryParts.join(' | ')] }) }));
|
|
67
64
|
};
|
|
68
65
|
//# sourceMappingURL=ContextSummaryDisplay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextSummaryDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/ContextSummaryDisplay.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextSummaryDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/ContextSummaryDisplay.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAW1D,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,GACX,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,eAAe,EAAE,CAAC;IACrD,MAAM,QAAQ,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IAC5D,MAAM,qBAAqB,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AM,CAAC,IAAI,aACjC,IAAI,QAAI,IAAI,KADJ,KAAK,CAET,CACR,CAAC,IACE,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,GAAG,cACF,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,wBAAU,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAQ,GAC9D,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Text } from 'ink';
|
|
8
|
+
import { Colors } from '../colors.js';
|
|
9
|
+
import { tokenLimit } from '@google/gemini-cli-core';
|
|
10
|
+
export const ContextUsageDisplay = ({ promptTokenCount, model, }) => {
|
|
11
|
+
const percentage = promptTokenCount / tokenLimit(model);
|
|
12
|
+
return (_jsxs(Text, { color: Colors.Gray, children: ["(", ((1 - percentage) * 100).toFixed(0), "% context left)"] }));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=ContextUsageDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextUsageDisplay.js","sourceRoot":"","sources":["../../../../src/ui/components/ContextUsageDisplay.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,gBAAgB,EAChB,KAAK,GAIN,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,gBAAgB,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;IAExD,OAAO,CACL,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,IAAI,kBACpB,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,uBAChC,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
export declare enum FolderTrustChoice {
|
|
8
|
+
TRUST_FOLDER = "trust_folder",
|
|
9
|
+
TRUST_PARENT = "trust_parent",
|
|
10
|
+
DO_NOT_TRUST = "do_not_trust"
|
|
11
|
+
}
|
|
12
|
+
interface FolderTrustDialogProps {
|
|
13
|
+
onSelect: (choice: FolderTrustChoice) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const FolderTrustDialog: React.FC<FolderTrustDialogProps>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2025 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/
|
|
7
|
+
import { Box, Text, useInput } from 'ink';
|
|
8
|
+
import { Colors } from '../colors.js';
|
|
9
|
+
import { RadioButtonSelect, } from './shared/RadioButtonSelect.js';
|
|
10
|
+
export var FolderTrustChoice;
|
|
11
|
+
(function (FolderTrustChoice) {
|
|
12
|
+
FolderTrustChoice["TRUST_FOLDER"] = "trust_folder";
|
|
13
|
+
FolderTrustChoice["TRUST_PARENT"] = "trust_parent";
|
|
14
|
+
FolderTrustChoice["DO_NOT_TRUST"] = "do_not_trust";
|
|
15
|
+
})(FolderTrustChoice || (FolderTrustChoice = {}));
|
|
16
|
+
export const FolderTrustDialog = ({ onSelect, }) => {
|
|
17
|
+
useInput((_, key) => {
|
|
18
|
+
if (key.escape) {
|
|
19
|
+
onSelect(FolderTrustChoice.DO_NOT_TRUST);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const options = [
|
|
23
|
+
{
|
|
24
|
+
label: 'Trust folder',
|
|
25
|
+
value: FolderTrustChoice.TRUST_FOLDER,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Trust parent folder',
|
|
29
|
+
value: FolderTrustChoice.TRUST_PARENT,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: "Don't trust (esc)",
|
|
33
|
+
value: FolderTrustChoice.DO_NOT_TRUST,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: Colors.AccentYellow, padding: 1, width: "100%", marginLeft: 1, children: [_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { bold: true, children: "Do you trust this folder?" }), _jsx(Text, { children: "Trusting a folder allows Gemini to execute commands it suggests. This is a security feature to prevent accidental execution in untrusted directories." })] }), _jsx(RadioButtonSelect, { items: options, onSelect: onSelect, isFocused: true })] }));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=FolderTrustDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FolderTrustDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/FolderTrustDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,iBAAiB,GAElB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;IAC7B,kDAA6B,CAAA;AAC/B,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AAMD,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAClE,QAAQ,GACT,EAAE,EAAE;IACH,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QAClB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,QAAQ,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,OAAO,GAA8C;QACzD;YACE,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,iBAAiB,CAAC,YAAY;SACtC;QACD;YACE,KAAK,EAAE,qBAAqB;YAC5B,KAAK,EAAE,iBAAiB,CAAC,YAAY;SACtC;QACD;YACE,KAAK,EAAE,mBAAmB;YAC1B,KAAK,EAAE,iBAAiB,CAAC,YAAY;SACtC;KACF,CAAC;IAEF,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,MAAM,CAAC,YAAY,EAChC,OAAO,EAAE,CAAC,EACV,KAAK,EAAC,MAAM,EACZ,UAAU,EAAE,CAAC,aAEb,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,KAAC,IAAI,IAAC,IAAI,gDAAiC,EAC3C,KAAC,IAAI,wKAIE,IACH,EAEN,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,SAAG,IAC/D,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
-
import {
|
|
4
|
-
import { shortenPath, tildeifyPath
|
|
3
|
+
import { theme } from '../semantic-colors.js';
|
|
4
|
+
import { shortenPath, tildeifyPath } from '@google/gemini-cli-core';
|
|
5
5
|
import { ConsoleSummaryDisplay } from './ConsoleSummaryDisplay.js';
|
|
6
6
|
import process from 'node:process';
|
|
7
|
+
import path from 'node:path';
|
|
7
8
|
import Gradient from 'ink-gradient';
|
|
8
9
|
import { MemoryUsageDisplay } from './MemoryUsageDisplay.js';
|
|
10
|
+
import { ContextUsageDisplay } from './ContextUsageDisplay.js';
|
|
9
11
|
import { DebugProfiler } from './DebugProfiler.js';
|
|
12
|
+
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
|
13
|
+
import { isNarrowWidth } from '../utils/isNarrowWidth.js';
|
|
10
14
|
export const Footer = ({ model, targetDir, branchName, debugMode, debugMessage, corgiMode, errorCount, showErrorDetails, showMemoryUsage, promptTokenCount, nightly, vimMode, }) => {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
15
|
+
const { columns: terminalWidth } = useTerminalSize();
|
|
16
|
+
const isNarrow = isNarrowWidth(terminalWidth);
|
|
17
|
+
// Adjust path length based on terminal width
|
|
18
|
+
const pathLength = Math.max(20, Math.floor(terminalWidth * 0.4));
|
|
19
|
+
const displayPath = isNarrow
|
|
20
|
+
? path.basename(tildeifyPath(targetDir))
|
|
21
|
+
: shortenPath(tildeifyPath(targetDir), pathLength);
|
|
22
|
+
return (_jsxs(Box, { justifyContent: "space-between", width: "100%", flexDirection: isNarrow ? 'column' : 'row', alignItems: isNarrow ? 'flex-start' : 'center', children: [_jsxs(Box, { children: [debugMode && _jsx(DebugProfiler, {}), vimMode && _jsxs(Text, { color: theme.text.secondary, children: ["[", vimMode, "] "] }), nightly ? (_jsx(Gradient, { colors: theme.ui.gradient, children: _jsxs(Text, { children: [displayPath, branchName && _jsxs(Text, { children: [" (", branchName, "*)"] })] }) })) : (_jsxs(Text, { color: theme.text.link, children: [displayPath, branchName && (_jsxs(Text, { color: theme.text.secondary, children: [" (", branchName, "*)"] }))] })), debugMode && (_jsx(Text, { color: theme.status.error, children: ' ' + (debugMessage || '--debug') }))] }), _jsx(Box, { flexGrow: isNarrow ? 0 : 1, alignItems: "center", justifyContent: isNarrow ? 'flex-start' : 'center', display: "flex", paddingX: isNarrow ? 0 : 1, paddingTop: isNarrow ? 1 : 0, children: process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec' ? (_jsx(Text, { color: "green", children: process.env.SANDBOX.replace(/^gemini-(?:cli-)?/, '') })) : process.env.SANDBOX === 'sandbox-exec' ? (_jsxs(Text, { color: theme.status.warning, children: ["macOS Seatbelt", ' ', _jsxs(Text, { color: theme.text.secondary, children: ["(", process.env.SEATBELT_PROFILE, ")"] })] })) : (_jsxs(Text, { color: theme.status.error, children: ["no sandbox ", _jsx(Text, { color: theme.text.secondary, children: "(see /docs)" })] })) }), _jsxs(Box, { alignItems: "center", paddingTop: isNarrow ? 1 : 0, children: [_jsxs(Text, { color: theme.text.accent, children: [isNarrow ? '' : ' ', model, ' ', _jsx(ContextUsageDisplay, { promptTokenCount: promptTokenCount, model: model })] }), corgiMode && (_jsxs(Text, { children: [_jsx(Text, { color: theme.ui.symbol, children: "| " }), _jsx(Text, { color: theme.status.error, children: "\u25BC" }), _jsx(Text, { color: theme.text.primary, children: "(\u00B4" }), _jsx(Text, { color: theme.status.error, children: "\u1D25" }), _jsx(Text, { color: theme.text.primary, children: "`)" }), _jsx(Text, { color: theme.status.error, children: "\u25BC " })] })), !showErrorDetails && errorCount > 0 && (_jsxs(Box, { children: [_jsx(Text, { color: theme.ui.symbol, children: "| " }), _jsx(ConsoleSummaryDisplay, { errorCount: errorCount })] })), showMemoryUsage && _jsx(MemoryUsageDisplay, {})] })] }));
|
|
14
23
|
};
|
|
15
24
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sourceRoot":"","sources":["../../../../src/ui/components/Footer.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAA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K,GACZ,IACG,EACN,SAAS,IAAI,CACZ,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,mBAAW,EACvC,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,uBAAU,EACzC,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,wBAAW,EAC1C,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,uBAAU,EACzC,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,mBAAW,EAC1C,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,wBAAW,IACrC,CACR,EACA,CAAC,gBAAgB,IAAI,UAAU,GAAG,CAAC,IAAI,CACtC,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,mBAAW,EACvC,KAAC,qBAAqB,IAAC,UAAU,EAAE,UAAU,GAAI,IAC7C,CACP,EACA,eAAe,IAAI,KAAC,kBAAkB,KAAG,IACtC,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -2,19 +2,27 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
import Gradient from 'ink-gradient';
|
|
4
4
|
import { Colors } from '../colors.js';
|
|
5
|
-
import { shortAsciiLogo, longAsciiLogo } from './AsciiArt.js';
|
|
5
|
+
import { shortAsciiLogo, longAsciiLogo, tinyAsciiLogo } from './AsciiArt.js';
|
|
6
6
|
import { getAsciiArtWidth } from '../utils/textUtils.js';
|
|
7
|
-
|
|
7
|
+
import { useTerminalSize } from '../hooks/useTerminalSize.js';
|
|
8
|
+
export const Header = ({ customAsciiArt, version, nightly, }) => {
|
|
9
|
+
const { columns: terminalWidth } = useTerminalSize();
|
|
8
10
|
let displayTitle;
|
|
9
11
|
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
|
|
12
|
+
const widthOfShortLogo = getAsciiArtWidth(shortAsciiLogo);
|
|
10
13
|
if (customAsciiArt) {
|
|
11
14
|
displayTitle = customAsciiArt;
|
|
12
15
|
}
|
|
16
|
+
else if (terminalWidth >= widthOfLongLogo) {
|
|
17
|
+
displayTitle = longAsciiLogo;
|
|
18
|
+
}
|
|
19
|
+
else if (terminalWidth >= widthOfShortLogo) {
|
|
20
|
+
displayTitle = shortAsciiLogo;
|
|
21
|
+
}
|
|
13
22
|
else {
|
|
14
|
-
displayTitle =
|
|
15
|
-
terminalWidth >= widthOfLongLogo ? longAsciiLogo : shortAsciiLogo;
|
|
23
|
+
displayTitle = tinyAsciiLogo;
|
|
16
24
|
}
|
|
17
25
|
const artWidth = getAsciiArtWidth(displayTitle);
|
|
18
|
-
return (_jsxs(Box, { alignItems: "flex-start", width: artWidth, flexShrink: 0, flexDirection: "column", children: [Colors.GradientColors ? (_jsx(Gradient, { colors: Colors.GradientColors, children: _jsx(Text, { children: displayTitle }) })) : (_jsx(Text, { children: displayTitle })), nightly && (_jsx(Box, { width: "100%", flexDirection: "row", justifyContent: "flex-end", children: _jsx(Gradient, { colors: Colors.GradientColors, children: _jsxs(Text, { children: ["v", version] }) }) }))] }));
|
|
26
|
+
return (_jsxs(Box, { alignItems: "flex-start", width: artWidth, flexShrink: 0, flexDirection: "column", children: [Colors.GradientColors ? (_jsx(Gradient, { colors: Colors.GradientColors, children: _jsx(Text, { children: displayTitle }) })) : (_jsx(Text, { children: displayTitle })), nightly && (_jsx(Box, { width: "100%", flexDirection: "row", justifyContent: "flex-end", children: Colors.GradientColors ? (_jsx(Gradient, { colors: Colors.GradientColors, children: _jsxs(Text, { children: ["v", version] }) })) : (_jsxs(Text, { children: ["v", version] })) }))] }));
|
|
19
27
|
};
|
|
20
28
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/ui/components/Header.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../src/ui/components/Header.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,QAAQ,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAQ9D,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAC5C,cAAc,EACd,OAAO,EACP,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,eAAe,EAAE,CAAC;IACrD,IAAI,YAAY,CAAC;IACjB,MAAM,eAAe,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAE1D,IAAI,cAAc,EAAE,CAAC;QACnB,YAAY,GAAG,cAAc,CAAC;IAChC,CAAC;SAAM,IAAI,aAAa,IAAI,eAAe,EAAE,CAAC;QAC5C,YAAY,GAAG,aAAa,CAAC;IAC/B,CAAC;SAAM,IAAI,aAAa,IAAI,gBAAgB,EAAE,CAAC;QAC7C,YAAY,GAAG,cAAc,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,YAAY,GAAG,aAAa,CAAC;IAC/B,CAAC;IAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAEhD,OAAO,CACL,MAAC,GAAG,IACF,UAAU,EAAC,YAAY,EACvB,KAAK,EAAE,QAAQ,EACf,UAAU,EAAE,CAAC,EACb,aAAa,EAAC,QAAQ,aAErB,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CACvB,KAAC,QAAQ,IAAC,MAAM,EAAE,MAAM,CAAC,cAAc,YACrC,KAAC,IAAI,cAAE,YAAY,GAAQ,GAClB,CACZ,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,cAAE,YAAY,GAAQ,CAC5B,EACA,OAAO,IAAI,CACV,KAAC,GAAG,IAAC,KAAK,EAAC,MAAM,EAAC,aAAa,EAAC,KAAK,EAAC,cAAc,EAAC,UAAU,YAC5D,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CACvB,KAAC,QAAQ,IAAC,MAAM,EAAE,MAAM,CAAC,cAAc,YACrC,MAAC,IAAI,oBAAG,OAAO,IAAQ,GACd,CACZ,CAAC,CAAC,CAAC,CACF,MAAC,IAAI,oBAAG,OAAO,IAAQ,CACxB,GACG,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -22,6 +22,7 @@ export interface InputPromptProps {
|
|
|
22
22
|
suggestionsWidth: number;
|
|
23
23
|
shellModeActive: boolean;
|
|
24
24
|
setShellModeActive: (value: boolean) => void;
|
|
25
|
+
onEscapePromptChange?: (showPrompt: boolean) => void;
|
|
25
26
|
vimHandleInput?: (key: Key) => boolean;
|
|
26
27
|
}
|
|
27
28
|
export declare const InputPrompt: React.FC<InputPromptProps>;
|
|
@@ -4,9 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
4
4
|
* Copyright 2025 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
6
6
|
*/
|
|
7
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
7
|
+
import { useCallback, useEffect, useState, useRef } from 'react';
|
|
8
8
|
import { Box, Text } from 'ink';
|
|
9
|
-
import {
|
|
9
|
+
import { theme } from '../semantic-colors.js';
|
|
10
10
|
import { SuggestionsDisplay } from './SuggestionsDisplay.js';
|
|
11
11
|
import { useInputHistory } from '../hooks/useInputHistory.js';
|
|
12
12
|
import { logicalPosToOffset } from './shared/text-buffer.js';
|
|
@@ -17,10 +17,14 @@ import { useShellHistory } from '../hooks/useShellHistory.js';
|
|
|
17
17
|
import { useReverseSearchCompletion } from '../hooks/useReverseSearchCompletion.js';
|
|
18
18
|
import { useCommandCompletion } from '../hooks/useCommandCompletion.js';
|
|
19
19
|
import { useKeypress } from '../hooks/useKeypress.js';
|
|
20
|
+
import { keyMatchers, Command } from '../keyMatchers.js';
|
|
20
21
|
import { clipboardHasImage, saveClipboardImage, cleanupOldClipboardImages, } from '../utils/clipboardUtils.js';
|
|
21
22
|
import * as path from 'path';
|
|
22
|
-
export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, config, slashCommands, commandContext, placeholder = ' Type your message or @path/to/file', focus = true, inputWidth, suggestionsWidth, shellModeActive, setShellModeActive, vimHandleInput, }) => {
|
|
23
|
+
export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, config, slashCommands, commandContext, placeholder = ' Type your message or @path/to/file', focus = true, inputWidth, suggestionsWidth, shellModeActive, setShellModeActive, onEscapePromptChange, vimHandleInput, }) => {
|
|
23
24
|
const [justNavigatedHistory, setJustNavigatedHistory] = useState(false);
|
|
25
|
+
const [escPressCount, setEscPressCount] = useState(0);
|
|
26
|
+
const [showEscapePrompt, setShowEscapePrompt] = useState(false);
|
|
27
|
+
const escapeTimerRef = useRef(null);
|
|
24
28
|
const [dirs, setDirs] = useState(config.getWorkspaceContext().getDirectories());
|
|
25
29
|
const dirsChanged = config.getWorkspaceContext().getDirectories();
|
|
26
30
|
useEffect(() => {
|
|
@@ -39,6 +43,26 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
39
43
|
const reverseSearchCompletion = useReverseSearchCompletion(buffer, historyData, reverseSearchActive);
|
|
40
44
|
const resetCompletionState = completion.resetCompletionState;
|
|
41
45
|
const resetReverseSearchCompletionState = reverseSearchCompletion.resetCompletionState;
|
|
46
|
+
const resetEscapeState = useCallback(() => {
|
|
47
|
+
if (escapeTimerRef.current) {
|
|
48
|
+
clearTimeout(escapeTimerRef.current);
|
|
49
|
+
escapeTimerRef.current = null;
|
|
50
|
+
}
|
|
51
|
+
setEscPressCount(0);
|
|
52
|
+
setShowEscapePrompt(false);
|
|
53
|
+
}, []);
|
|
54
|
+
// Notify parent component about escape prompt state changes
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (onEscapePromptChange) {
|
|
57
|
+
onEscapePromptChange(showEscapePrompt);
|
|
58
|
+
}
|
|
59
|
+
}, [showEscapePrompt, onEscapePromptChange]);
|
|
60
|
+
// Clear escape prompt timer on unmount
|
|
61
|
+
useEffect(() => () => {
|
|
62
|
+
if (escapeTimerRef.current) {
|
|
63
|
+
clearTimeout(escapeTimerRef.current);
|
|
64
|
+
}
|
|
65
|
+
}, []);
|
|
42
66
|
const handleSubmitAndClear = useCallback((submittedValue) => {
|
|
43
67
|
if (shellModeActive) {
|
|
44
68
|
shellHistory.addCommandToHistory(submittedValue);
|
|
@@ -132,6 +156,12 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
132
156
|
if (vimHandleInput && vimHandleInput(key)) {
|
|
133
157
|
return;
|
|
134
158
|
}
|
|
159
|
+
// Reset ESC count and hide prompt on any non-ESC key
|
|
160
|
+
if (key.name !== 'escape') {
|
|
161
|
+
if (escPressCount > 0 || showEscapePrompt) {
|
|
162
|
+
resetEscapeState();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
135
165
|
if (key.sequence === '!' &&
|
|
136
166
|
buffer.text === '' &&
|
|
137
167
|
!completion.showSuggestions) {
|
|
@@ -139,7 +169,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
139
169
|
buffer.setText(''); // Clear the '!' from input
|
|
140
170
|
return;
|
|
141
171
|
}
|
|
142
|
-
if (key
|
|
172
|
+
if (keyMatchers[Command.ESCAPE](key)) {
|
|
143
173
|
if (reverseSearchActive) {
|
|
144
174
|
setReverseSearchActive(false);
|
|
145
175
|
reverseSearchCompletion.resetCompletionState();
|
|
@@ -150,42 +180,65 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
150
180
|
}
|
|
151
181
|
if (shellModeActive) {
|
|
152
182
|
setShellModeActive(false);
|
|
183
|
+
resetEscapeState();
|
|
153
184
|
return;
|
|
154
185
|
}
|
|
155
186
|
if (completion.showSuggestions) {
|
|
156
187
|
completion.resetCompletionState();
|
|
188
|
+
resetEscapeState();
|
|
157
189
|
return;
|
|
158
190
|
}
|
|
191
|
+
// Handle double ESC for clearing input
|
|
192
|
+
if (escPressCount === 0) {
|
|
193
|
+
if (buffer.text === '') {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
setEscPressCount(1);
|
|
197
|
+
setShowEscapePrompt(true);
|
|
198
|
+
if (escapeTimerRef.current) {
|
|
199
|
+
clearTimeout(escapeTimerRef.current);
|
|
200
|
+
}
|
|
201
|
+
escapeTimerRef.current = setTimeout(() => {
|
|
202
|
+
resetEscapeState();
|
|
203
|
+
}, 500);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
// clear input and immediately reset state
|
|
207
|
+
buffer.setText('');
|
|
208
|
+
resetCompletionState();
|
|
209
|
+
resetEscapeState();
|
|
210
|
+
}
|
|
211
|
+
return;
|
|
159
212
|
}
|
|
160
|
-
if (shellModeActive &&
|
|
213
|
+
if (shellModeActive && keyMatchers[Command.REVERSE_SEARCH](key)) {
|
|
161
214
|
setReverseSearchActive(true);
|
|
162
215
|
setTextBeforeReverseSearch(buffer.text);
|
|
163
216
|
setCursorPosition(buffer.cursor);
|
|
164
217
|
return;
|
|
165
218
|
}
|
|
166
|
-
if (
|
|
219
|
+
if (keyMatchers[Command.CLEAR_SCREEN](key)) {
|
|
167
220
|
onClearScreen();
|
|
168
221
|
return;
|
|
169
222
|
}
|
|
170
223
|
if (reverseSearchActive) {
|
|
171
224
|
const { activeSuggestionIndex, navigateUp, navigateDown, showSuggestions, suggestions, } = reverseSearchCompletion;
|
|
172
225
|
if (showSuggestions) {
|
|
173
|
-
if (key
|
|
226
|
+
if (keyMatchers[Command.NAVIGATION_UP](key)) {
|
|
174
227
|
navigateUp();
|
|
175
228
|
return;
|
|
176
229
|
}
|
|
177
|
-
if (key
|
|
230
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
178
231
|
navigateDown();
|
|
179
232
|
return;
|
|
180
233
|
}
|
|
181
|
-
if (key
|
|
234
|
+
if (keyMatchers[Command.ACCEPT_SUGGESTION_REVERSE_SEARCH](key)) {
|
|
182
235
|
reverseSearchCompletion.handleAutocomplete(activeSuggestionIndex);
|
|
183
236
|
reverseSearchCompletion.resetCompletionState();
|
|
184
237
|
setReverseSearchActive(false);
|
|
185
238
|
return;
|
|
186
239
|
}
|
|
187
240
|
}
|
|
188
|
-
if (
|
|
241
|
+
if (keyMatchers[Command.SUBMIT_REVERSE_SEARCH](key)) {
|
|
189
242
|
const textToSubmit = showSuggestions && activeSuggestionIndex > -1
|
|
190
243
|
? suggestions[activeSuggestionIndex].value
|
|
191
244
|
: buffer.text;
|
|
@@ -195,27 +248,28 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
195
248
|
return;
|
|
196
249
|
}
|
|
197
250
|
// Prevent up/down from falling through to regular history navigation
|
|
198
|
-
if (
|
|
251
|
+
if (keyMatchers[Command.NAVIGATION_UP](key) ||
|
|
252
|
+
keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
199
253
|
return;
|
|
200
254
|
}
|
|
201
255
|
}
|
|
202
256
|
// If the command is a perfect match, pressing enter should execute it.
|
|
203
|
-
if (completion.isPerfectMatch && key
|
|
257
|
+
if (completion.isPerfectMatch && keyMatchers[Command.RETURN](key)) {
|
|
204
258
|
handleSubmitAndClear(buffer.text);
|
|
205
259
|
return;
|
|
206
260
|
}
|
|
207
261
|
if (completion.showSuggestions) {
|
|
208
262
|
if (completion.suggestions.length > 1) {
|
|
209
|
-
if (
|
|
263
|
+
if (keyMatchers[Command.COMPLETION_UP](key)) {
|
|
210
264
|
completion.navigateUp();
|
|
211
265
|
return;
|
|
212
266
|
}
|
|
213
|
-
if (
|
|
267
|
+
if (keyMatchers[Command.COMPLETION_DOWN](key)) {
|
|
214
268
|
completion.navigateDown();
|
|
215
269
|
return;
|
|
216
270
|
}
|
|
217
271
|
}
|
|
218
|
-
if (
|
|
272
|
+
if (keyMatchers[Command.ACCEPT_SUGGESTION](key)) {
|
|
219
273
|
if (completion.suggestions.length > 0) {
|
|
220
274
|
const targetIndex = completion.activeSuggestionIndex === -1
|
|
221
275
|
? 0 // Default to the first if none is active
|
|
@@ -228,22 +282,22 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
228
282
|
}
|
|
229
283
|
}
|
|
230
284
|
if (!shellModeActive) {
|
|
231
|
-
if (
|
|
285
|
+
if (keyMatchers[Command.HISTORY_UP](key)) {
|
|
232
286
|
inputHistory.navigateUp();
|
|
233
287
|
return;
|
|
234
288
|
}
|
|
235
|
-
if (
|
|
289
|
+
if (keyMatchers[Command.HISTORY_DOWN](key)) {
|
|
236
290
|
inputHistory.navigateDown();
|
|
237
291
|
return;
|
|
238
292
|
}
|
|
239
293
|
// Handle arrow-up/down for history on single-line or at edges
|
|
240
|
-
if (key
|
|
294
|
+
if (keyMatchers[Command.NAVIGATION_UP](key) &&
|
|
241
295
|
(buffer.allVisualLines.length === 1 ||
|
|
242
296
|
(buffer.visualCursor[0] === 0 && buffer.visualScrollRow === 0))) {
|
|
243
297
|
inputHistory.navigateUp();
|
|
244
298
|
return;
|
|
245
299
|
}
|
|
246
|
-
if (key
|
|
300
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key) &&
|
|
247
301
|
(buffer.allVisualLines.length === 1 ||
|
|
248
302
|
buffer.visualCursor[0] === buffer.allVisualLines.length - 1)) {
|
|
249
303
|
inputHistory.navigateDown();
|
|
@@ -251,20 +305,21 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
251
305
|
}
|
|
252
306
|
}
|
|
253
307
|
else {
|
|
254
|
-
|
|
308
|
+
// Shell History Navigation
|
|
309
|
+
if (keyMatchers[Command.NAVIGATION_UP](key)) {
|
|
255
310
|
const prevCommand = shellHistory.getPreviousCommand();
|
|
256
311
|
if (prevCommand !== null)
|
|
257
312
|
buffer.setText(prevCommand);
|
|
258
313
|
return;
|
|
259
314
|
}
|
|
260
|
-
if (key
|
|
315
|
+
if (keyMatchers[Command.NAVIGATION_DOWN](key)) {
|
|
261
316
|
const nextCommand = shellHistory.getNextCommand();
|
|
262
317
|
if (nextCommand !== null)
|
|
263
318
|
buffer.setText(nextCommand);
|
|
264
319
|
return;
|
|
265
320
|
}
|
|
266
321
|
}
|
|
267
|
-
if (
|
|
322
|
+
if (keyMatchers[Command.SUBMIT](key)) {
|
|
268
323
|
if (buffer.text.trim()) {
|
|
269
324
|
const [row, col] = buffer.cursor;
|
|
270
325
|
const line = buffer.lines[row];
|
|
@@ -280,46 +335,44 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
280
335
|
return;
|
|
281
336
|
}
|
|
282
337
|
// Newline insertion
|
|
283
|
-
if (
|
|
338
|
+
if (keyMatchers[Command.NEWLINE](key)) {
|
|
284
339
|
buffer.newline();
|
|
285
340
|
return;
|
|
286
341
|
}
|
|
287
342
|
// Ctrl+A (Home) / Ctrl+E (End)
|
|
288
|
-
if (
|
|
343
|
+
if (keyMatchers[Command.HOME](key)) {
|
|
289
344
|
buffer.move('home');
|
|
290
345
|
return;
|
|
291
346
|
}
|
|
292
|
-
if (
|
|
347
|
+
if (keyMatchers[Command.END](key)) {
|
|
293
348
|
buffer.move('end');
|
|
294
349
|
buffer.moveToOffset(cpLen(buffer.text));
|
|
295
350
|
return;
|
|
296
351
|
}
|
|
297
352
|
// Ctrl+C (Clear input)
|
|
298
|
-
if (
|
|
353
|
+
if (keyMatchers[Command.CLEAR_INPUT](key)) {
|
|
299
354
|
if (buffer.text.length > 0) {
|
|
300
355
|
buffer.setText('');
|
|
301
356
|
resetCompletionState();
|
|
302
|
-
return;
|
|
303
357
|
}
|
|
304
358
|
return;
|
|
305
359
|
}
|
|
306
360
|
// Kill line commands
|
|
307
|
-
if (
|
|
361
|
+
if (keyMatchers[Command.KILL_LINE_RIGHT](key)) {
|
|
308
362
|
buffer.killLineRight();
|
|
309
363
|
return;
|
|
310
364
|
}
|
|
311
|
-
if (
|
|
365
|
+
if (keyMatchers[Command.KILL_LINE_LEFT](key)) {
|
|
312
366
|
buffer.killLineLeft();
|
|
313
367
|
return;
|
|
314
368
|
}
|
|
315
369
|
// External editor
|
|
316
|
-
|
|
317
|
-
if (isCtrlX) {
|
|
370
|
+
if (keyMatchers[Command.OPEN_EXTERNAL_EDITOR](key)) {
|
|
318
371
|
buffer.openInExternalEditor();
|
|
319
372
|
return;
|
|
320
373
|
}
|
|
321
374
|
// Ctrl+V for clipboard image paste
|
|
322
|
-
if (
|
|
375
|
+
if (keyMatchers[Command.PASTE_CLIPBOARD_IMAGE](key)) {
|
|
323
376
|
handleClipboardImage();
|
|
324
377
|
return;
|
|
325
378
|
}
|
|
@@ -338,6 +391,9 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
338
391
|
reverseSearchCompletion,
|
|
339
392
|
handleClipboardImage,
|
|
340
393
|
resetCompletionState,
|
|
394
|
+
escPressCount,
|
|
395
|
+
showEscapePrompt,
|
|
396
|
+
resetEscapeState,
|
|
341
397
|
vimHandleInput,
|
|
342
398
|
reverseSearchActive,
|
|
343
399
|
textBeforeReverseSearch,
|
|
@@ -347,7 +403,7 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
347
403
|
const linesToRender = buffer.viewportVisualLines;
|
|
348
404
|
const [cursorVisualRowAbsolute, cursorVisualColAbsolute] = buffer.visualCursor;
|
|
349
405
|
const scrollVisualRow = buffer.visualScrollRow;
|
|
350
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Box, { borderStyle: "round", borderColor: shellModeActive ?
|
|
406
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { borderStyle: "round", borderColor: shellModeActive ? theme.status.warning : theme.border.focused, paddingX: 1, children: [_jsx(Text, { color: shellModeActive ? theme.status.warning : theme.text.accent, children: shellModeActive ? (reverseSearchActive ? (_jsx(Text, { color: theme.text.link, children: "(r:) " })) : ('! ')) : ('> ') }), _jsx(Box, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? (focus ? (_jsxs(Text, { children: [chalk.inverse(placeholder.slice(0, 1)), _jsx(Text, { color: theme.text.secondary, children: placeholder.slice(1) })] })) : (_jsx(Text, { color: theme.text.secondary, children: placeholder }))) : (linesToRender.map((lineText, visualIdxInRenderedSet) => {
|
|
351
407
|
const cursorVisualRow = cursorVisualRowAbsolute - scrollVisualRow;
|
|
352
408
|
let display = cpSlice(lineText, 0, inputWidth);
|
|
353
409
|
const currentVisualWidth = stringWidth(display);
|
|
@@ -372,6 +428,6 @@ export const InputPrompt = ({ buffer, onSubmit, userMessages, onClearScreen, con
|
|
|
372
428
|
}
|
|
373
429
|
}
|
|
374
430
|
return (_jsx(Text, { children: display }, `line-${visualIdxInRenderedSet}`));
|
|
375
|
-
})) })] }), completion.showSuggestions && (_jsx(Box, { children: _jsx(SuggestionsDisplay, { suggestions: completion.suggestions, activeIndex: completion.activeSuggestionIndex, isLoading: completion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: completion.visibleStartIndex, userInput: buffer.text }) })), reverseSearchActive && (_jsx(Box, { children: _jsx(SuggestionsDisplay, { suggestions: reverseSearchCompletion.suggestions, activeIndex: reverseSearchCompletion.activeSuggestionIndex, isLoading: reverseSearchCompletion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: reverseSearchCompletion.visibleStartIndex, userInput: buffer.text }) }))] }));
|
|
431
|
+
})) })] }), completion.showSuggestions && (_jsx(Box, { paddingRight: 2, children: _jsx(SuggestionsDisplay, { suggestions: completion.suggestions, activeIndex: completion.activeSuggestionIndex, isLoading: completion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: completion.visibleStartIndex, userInput: buffer.text }) })), reverseSearchActive && (_jsx(Box, { paddingRight: 2, children: _jsx(SuggestionsDisplay, { suggestions: reverseSearchCompletion.suggestions, activeIndex: reverseSearchCompletion.activeSuggestionIndex, isLoading: reverseSearchCompletion.isLoadingSuggestions, width: suggestionsWidth, scrollOffset: reverseSearchCompletion.visibleStartIndex, userInput: buffer.text }) }))] }));
|
|
376
432
|
};
|
|
377
433
|
//# sourceMappingURL=InputPrompt.js.map
|