@google/gemini-cli 0.1.14 → 0.1.15-nightly.250801.6f7beb41
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 +28 -0
- package/dist/google-gemini-cli-0.1.15.tgz +0 -0
- package/dist/package.json +2 -2
- package/dist/src/config/config.d.ts +4 -2
- package/dist/src/config/config.js +25 -12
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/extension.d.ts +1 -0
- package/dist/src/config/extension.js +4 -0
- package/dist/src/config/extension.js.map +1 -1
- package/dist/src/config/settings.d.ts +4 -0
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.d.ts +1 -0
- package/dist/src/gemini.js +34 -15
- 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 +1 -1
- package/dist/src/nonInteractiveCli.js +14 -37
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +9 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/services/CommandService.d.ts +8 -4
- package/dist/src/services/CommandService.js +24 -8
- package/dist/src/services/CommandService.js.map +1 -1
- package/dist/src/services/FileCommandLoader.d.ts +15 -3
- package/dist/src/services/FileCommandLoader.js +94 -42
- package/dist/src/services/FileCommandLoader.js.map +1 -1
- package/dist/src/services/McpPromptLoader.d.ts +25 -0
- package/dist/src/services/McpPromptLoader.js +192 -0
- package/dist/src/services/McpPromptLoader.js.map +1 -0
- package/dist/src/services/prompt-processors/shellProcessor.d.ts +32 -0
- package/dist/src/services/prompt-processors/shellProcessor.js +77 -0
- package/dist/src/services/prompt-processors/shellProcessor.js.map +1 -0
- package/dist/src/services/prompt-processors/types.d.ts +4 -0
- package/dist/src/services/prompt-processors/types.js +4 -0
- package/dist/src/services/prompt-processors/types.js.map +1 -1
- package/dist/src/ui/App.js +89 -46
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/chatCommand.js +39 -1
- package/dist/src/ui/commands/chatCommand.js.map +1 -1
- package/dist/src/ui/commands/directoryCommand.d.ts +8 -0
- package/dist/src/ui/commands/directoryCommand.js +116 -0
- package/dist/src/ui/commands/directoryCommand.js.map +1 -0
- package/dist/src/ui/commands/ideCommand.js +101 -105
- package/dist/src/ui/commands/ideCommand.js.map +1 -1
- package/dist/src/ui/commands/initCommand.d.ts +7 -0
- package/dist/src/ui/commands/initCommand.js +76 -0
- package/dist/src/ui/commands/initCommand.js.map +1 -0
- package/dist/src/ui/commands/mcpCommand.js +53 -8
- package/dist/src/ui/commands/mcpCommand.js.map +1 -1
- package/dist/src/ui/commands/memoryCommand.js +2 -1
- package/dist/src/ui/commands/memoryCommand.js.map +1 -1
- package/dist/src/ui/commands/setupGithubCommand.d.ts +7 -0
- package/dist/src/ui/commands/setupGithubCommand.js +49 -0
- package/dist/src/ui/commands/setupGithubCommand.js.map +1 -0
- package/dist/src/ui/commands/types.d.ts +20 -2
- package/dist/src/ui/commands/types.js +1 -0
- package/dist/src/ui/commands/types.js.map +1 -1
- package/dist/src/ui/commands/vimCommand.d.ts +7 -0
- package/dist/src/ui/commands/vimCommand.js +23 -0
- package/dist/src/ui/commands/vimCommand.js.map +1 -0
- package/dist/src/ui/components/ContextSummaryDisplay.d.ts +2 -2
- package/dist/src/ui/components/ContextSummaryDisplay.js +8 -8
- package/dist/src/ui/components/ContextSummaryDisplay.js.map +1 -1
- package/dist/src/ui/components/DebugProfiler.d.ts +6 -0
- package/dist/src/ui/components/DebugProfiler.js +26 -0
- package/dist/src/ui/components/DebugProfiler.js.map +1 -0
- package/dist/src/ui/components/Footer.d.ts +1 -0
- package/dist/src/ui/components/Footer.js +4 -3
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/Header.js +1 -1
- package/dist/src/ui/components/Header.js.map +1 -1
- package/dist/src/ui/components/Help.js +2 -2
- package/dist/src/ui/components/Help.js.map +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +4 -3
- package/dist/src/ui/components/IDEContextDetailDisplay.js +6 -13
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.d.ts +2 -0
- package/dist/src/ui/components/InputPrompt.js +13 -2
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/ShellConfirmationDialog.d.ts +15 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js +44 -0
- package/dist/src/ui/components/ShellConfirmationDialog.js.map +1 -0
- package/dist/src/ui/components/Tips.js +1 -1
- package/dist/src/ui/components/Tips.js.map +1 -1
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js +15 -4
- package/dist/src/ui/components/messages/ToolConfirmationMessage.js.map +1 -1
- package/dist/src/ui/components/messages/UserMessage.js +4 -1
- package/dist/src/ui/components/messages/UserMessage.js.map +1 -1
- package/dist/src/ui/components/shared/text-buffer.d.ts +270 -2
- package/dist/src/ui/components/shared/text-buffer.js +410 -70
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/components/shared/vim-buffer-actions.d.ts +72 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js +565 -0
- package/dist/src/ui/components/shared/vim-buffer-actions.js.map +1 -0
- package/dist/src/ui/contexts/VimModeContext.d.ts +19 -0
- package/dist/src/ui/contexts/VimModeContext.js +48 -0
- package/dist/src/ui/contexts/VimModeContext.js.map +1 -0
- package/dist/src/ui/editors/editorSettingsManager.js +1 -0
- package/dist/src/ui/editors/editorSettingsManager.js.map +1 -1
- package/dist/src/ui/hooks/atCommandProcessor.js +56 -48
- package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/shellCommandProcessor.d.ts +1 -0
- package/dist/src/ui/hooks/shellCommandProcessor.js +139 -200
- package/dist/src/ui/hooks/shellCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.d.ts +7 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js +198 -127
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +1 -1
- package/dist/src/ui/hooks/useCompletion.js +108 -76
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useConsoleMessages.js +53 -37
- package/dist/src/ui/hooks/useConsoleMessages.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +5 -2
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useKeypress.js +5 -2
- package/dist/src/ui/hooks/useKeypress.js.map +1 -1
- package/dist/src/ui/hooks/usePhraseCycler.js +1 -0
- package/dist/src/ui/hooks/usePhraseCycler.js.map +1 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js +0 -1
- package/dist/src/ui/hooks/useReactToolScheduler.js.map +1 -1
- package/dist/src/ui/hooks/vim.d.ts +28 -0
- package/dist/src/ui/hooks/vim.js +630 -0
- package/dist/src/ui/hooks/vim.js.map +1 -0
- package/dist/src/ui/themes/theme-manager.js +10 -1
- package/dist/src/ui/themes/theme-manager.js.map +1 -1
- package/dist/src/ui/themes/theme.d.ts +1 -0
- package/dist/src/ui/themes/theme.js +19 -4
- package/dist/src/ui/themes/theme.js.map +1 -1
- package/dist/src/ui/utils/textUtils.d.ts +0 -8
- package/dist/src/ui/utils/textUtils.js +0 -22
- package/dist/src/ui/utils/textUtils.js.map +1 -1
- package/dist/src/ui/utils/updateCheck.d.ts +7 -1
- package/dist/src/ui/utils/updateCheck.js +9 -3
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- package/dist/src/utils/events.d.ts +11 -0
- package/dist/src/utils/events.js +13 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/gitUtils.d.ts +10 -0
- package/dist/src/utils/gitUtils.js +24 -0
- package/dist/src/utils/gitUtils.js.map +1 -0
- package/dist/src/utils/handleAutoUpdate.d.ts +10 -0
- package/dist/src/utils/handleAutoUpdate.js +97 -0
- package/dist/src/utils/handleAutoUpdate.js.map +1 -0
- package/dist/src/utils/installationInfo.d.ts +23 -0
- package/dist/src/utils/installationInfo.js +154 -0
- package/dist/src/utils/installationInfo.js.map +1 -0
- package/dist/src/utils/sandbox-macos-permissive-closed.sb +6 -0
- package/dist/src/utils/sandbox-macos-permissive-open.sb +6 -0
- package/dist/src/utils/sandbox-macos-permissive-proxied.sb +6 -0
- package/dist/src/utils/sandbox-macos-restrictive-closed.sb +6 -0
- package/dist/src/utils/sandbox-macos-restrictive-open.sb +6 -0
- package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +6 -0
- package/dist/src/utils/sandbox.d.ts +2 -2
- package/dist/src/utils/sandbox.js +29 -10
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/updateEventEmitter.d.ts +11 -0
- package/dist/src/utils/updateEventEmitter.js +12 -0
- package/dist/src/utils/updateEventEmitter.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/google-gemini-cli-0.1.13.tgz +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
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 { ToolConfirmationOutcome } from '@google/gemini-cli-core';
|
|
8
|
+
import { Box, Text, useInput } from 'ink';
|
|
9
|
+
import { Colors } from '../colors.js';
|
|
10
|
+
import { RadioButtonSelect, } from './shared/RadioButtonSelect.js';
|
|
11
|
+
export const ShellConfirmationDialog = ({ request }) => {
|
|
12
|
+
const { commands, onConfirm } = request;
|
|
13
|
+
useInput((_, key) => {
|
|
14
|
+
if (key.escape) {
|
|
15
|
+
onConfirm(ToolConfirmationOutcome.Cancel);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const handleSelect = (item) => {
|
|
19
|
+
if (item === ToolConfirmationOutcome.Cancel) {
|
|
20
|
+
onConfirm(item);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// For both ProceedOnce and ProceedAlways, we approve all the
|
|
24
|
+
// commands that were requested.
|
|
25
|
+
onConfirm(item, commands);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const options = [
|
|
29
|
+
{
|
|
30
|
+
label: 'Yes, allow once',
|
|
31
|
+
value: ToolConfirmationOutcome.ProceedOnce,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: 'Yes, allow always for this session',
|
|
35
|
+
value: ToolConfirmationOutcome.ProceedAlways,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: 'No (esc)',
|
|
39
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
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: "Shell Command Execution" }), _jsx(Text, { children: "A custom command wants to run the following shell commands:" }), _jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: Colors.Gray, paddingX: 1, marginTop: 1, children: commands.map((cmd) => (_jsx(Text, { color: Colors.AccentCyan, children: cmd }, cmd))) })] }), _jsx(Box, { marginBottom: 1, children: _jsx(Text, { children: "Do you want to proceed?" }) }), _jsx(RadioButtonSelect, { items: options, onSelect: handleSelect, isFocused: true })] }));
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=ShellConfirmationDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShellConfirmationDialog.js","sourceRoot":"","sources":["../../../../src/ui/components/ShellConfirmationDialog.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAA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b,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,KAAC,IAAI,IAAC,IAAI,8CAA+B,EACzC,KAAC,IAAI,8EAAmE,EACxE,KAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,MAAM,CAAC,IAAI,EACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,YAEX,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CACrB,KAAC,IAAI,IAAW,KAAK,EAAE,MAAM,CAAC,UAAU,YACrC,GAAG,IADK,GAAG,CAEP,CACR,CAAC,GACE,IACF,EAEN,KAAC,GAAG,IAAC,YAAY,EAAE,CAAC,YAClB,KAAC,IAAI,0CAA+B,GAChC,EAEN,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,SAAG,IACnE,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -3,6 +3,6 @@ import { Box, Text } from 'ink';
|
|
|
3
3
|
import { Colors } from '../colors.js';
|
|
4
4
|
export const Tips = ({ config }) => {
|
|
5
5
|
const geminiMdFileCount = config.getGeminiMdFileCount();
|
|
6
|
-
return (_jsxs(Box, { flexDirection: "column",
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: Colors.Foreground, children: "Tips for getting started:" }), _jsx(Text, { color: Colors.Foreground, children: "1. Ask questions, edit files, or run commands." }), _jsx(Text, { color: Colors.Foreground, children: "2. Be specific for the best results." }), geminiMdFileCount === 0 && (_jsxs(Text, { color: Colors.Foreground, children: ["3. Create", ' ', _jsx(Text, { bold: true, color: Colors.AccentPurple, children: "GEMINI.md" }), ' ', "files to customize your interactions with Gemini."] })), _jsxs(Text, { color: Colors.Foreground, children: [geminiMdFileCount === 0 ? '4.' : '3.', ' ', _jsx(Text, { bold: true, color: Colors.AccentPurple, children: "/help" }), ' ', "for more information."] })] }));
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=Tips.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tips.js","sourceRoot":"","sources":["../../../../src/ui/components/Tips.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAOtC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IACtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;IACxD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"Tips.js","sourceRoot":"","sources":["../../../../src/ui/components/Tips.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAOtC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;IACtD,MAAM,iBAAiB,GAAG,MAAM,CAAC,oBAAoB,EAAE,CAAC;IACxD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,0CAAkC,EAChE,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,+DAEvB,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,qDAEvB,EACN,iBAAiB,KAAK,CAAC,IAAI,CAC1B,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,0BAClB,GAAG,EACb,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,CAAC,YAAY,0BAE9B,EAAC,GAAG,yDAEN,CACR,EACD,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,UAAU,aAC3B,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAC3C,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAE,MAAM,CAAC,YAAY,sBAE9B,EAAC,GAAG,6BAEN,IACH,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -57,7 +57,10 @@ export const ToolConfirmationMessage = ({ confirmationDetails, isFocused = true,
|
|
|
57
57
|
}, {
|
|
58
58
|
label: 'Modify with external editor',
|
|
59
59
|
value: ToolConfirmationOutcome.ModifyWithEditor,
|
|
60
|
-
}, {
|
|
60
|
+
}, {
|
|
61
|
+
label: 'No, suggest changes (esc)',
|
|
62
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
63
|
+
});
|
|
61
64
|
bodyContent = (_jsx(DiffRenderer, { diffContent: confirmationDetails.fileDiff, filename: confirmationDetails.fileName, availableTerminalHeight: availableBodyContentHeight(), terminalWidth: childWidth }));
|
|
62
65
|
}
|
|
63
66
|
else if (confirmationDetails.type === 'exec') {
|
|
@@ -69,8 +72,10 @@ export const ToolConfirmationMessage = ({ confirmationDetails, isFocused = true,
|
|
|
69
72
|
}, {
|
|
70
73
|
label: `Yes, allow always ...`,
|
|
71
74
|
value: ToolConfirmationOutcome.ProceedAlways,
|
|
75
|
+
}, {
|
|
76
|
+
label: 'No, suggest changes (esc)',
|
|
77
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
72
78
|
});
|
|
73
|
-
options.push({ label: 'No (esc)', value: ToolConfirmationOutcome.Cancel });
|
|
74
79
|
let bodyContentHeight = availableBodyContentHeight();
|
|
75
80
|
if (bodyContentHeight !== undefined) {
|
|
76
81
|
bodyContentHeight -= 2; // Account for padding;
|
|
@@ -88,7 +93,10 @@ export const ToolConfirmationMessage = ({ confirmationDetails, isFocused = true,
|
|
|
88
93
|
}, {
|
|
89
94
|
label: 'Yes, allow always',
|
|
90
95
|
value: ToolConfirmationOutcome.ProceedAlways,
|
|
91
|
-
}, {
|
|
96
|
+
}, {
|
|
97
|
+
label: 'No, suggest changes (esc)',
|
|
98
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
99
|
+
});
|
|
92
100
|
bodyContent = (_jsxs(Box, { flexDirection: "column", paddingX: 1, marginLeft: 1, children: [_jsx(Text, { color: Colors.AccentCyan, children: infoProps.prompt }), displayUrls && infoProps.urls && infoProps.urls.length > 0 && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { children: "URLs to fetch:" }), infoProps.urls.map((url) => (_jsxs(Text, { children: [" - ", url] }, url)))] }))] }));
|
|
93
101
|
}
|
|
94
102
|
else {
|
|
@@ -105,7 +113,10 @@ export const ToolConfirmationMessage = ({ confirmationDetails, isFocused = true,
|
|
|
105
113
|
}, {
|
|
106
114
|
label: `Yes, always allow all tools from server "${mcpProps.serverName}"`,
|
|
107
115
|
value: ToolConfirmationOutcome.ProceedAlwaysServer,
|
|
108
|
-
}, {
|
|
116
|
+
}, {
|
|
117
|
+
label: 'No, suggest changes (esc)',
|
|
118
|
+
value: ToolConfirmationOutcome.Cancel,
|
|
119
|
+
});
|
|
109
120
|
}
|
|
110
121
|
return (_jsxs(Box, { flexDirection: "column", padding: 1, width: childWidth, children: [_jsx(Box, { flexGrow: 1, flexShrink: 1, overflow: "hidden", marginBottom: 1, children: bodyContent }), _jsx(Box, { marginBottom: 1, flexShrink: 0, children: _jsx(Text, { wrap: "truncate", children: question }) }), _jsx(Box, { flexShrink: 0, children: _jsx(RadioButtonSelect, { items: options, onSelect: handleSelect, isFocused: isFocused }) })] }));
|
|
111
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToolConfirmationMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/ToolConfirmationMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,GAAG,EAAE,I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Q,GAAQ,GACnC,EAGN,KAAC,GAAG,IAAC,UAAU,EAAE,CAAC,YAChB,KAAC,iBAAiB,IAChB,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,GACpB,GACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,6 +4,9 @@ import { Colors } from '../../colors.js';
|
|
|
4
4
|
export const UserMessage = ({ text }) => {
|
|
5
5
|
const prefix = '> ';
|
|
6
6
|
const prefixWidth = prefix.length;
|
|
7
|
-
|
|
7
|
+
const isSlashCommand = text.startsWith('/');
|
|
8
|
+
const textColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
|
|
9
|
+
const borderColor = isSlashCommand ? Colors.AccentPurple : Colors.Gray;
|
|
10
|
+
return (_jsxs(Box, { borderStyle: "round", borderColor: borderColor, flexDirection: "row", paddingX: 2, paddingY: 0, marginY: 1, alignSelf: "flex-start", children: [_jsx(Box, { width: prefixWidth, children: _jsx(Text, { color: textColor, children: prefix }) }), _jsx(Box, { flexGrow: 1, children: _jsx(Text, { wrap: "wrap", color: textColor, children: text }) })] }));
|
|
8
11
|
};
|
|
9
12
|
//# sourceMappingURL=UserMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/UserMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMzC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"UserMessage.js","sourceRoot":"","sources":["../../../../../src/ui/components/messages/UserMessage.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAMzC,MAAM,CAAC,MAAM,WAAW,GAA+B,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IAClC,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IACrE,MAAM,WAAW,GAAG,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAEvE,OAAO,CACL,MAAC,GAAG,IACF,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAC,KAAK,EACnB,QAAQ,EAAE,CAAC,EACX,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,CAAC,EACV,SAAS,EAAC,YAAY,aAEtB,KAAC,GAAG,IAAC,KAAK,EAAE,WAAW,YACrB,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,MAAM,GAAQ,GACnC,EACN,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,SAAS,YAC/B,IAAI,GACA,GACH,IACF,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
export type Direction = 'left' | 'right' | 'up' | 'down' | 'wordLeft' | 'wordRight' | 'home' | 'end';
|
|
7
|
+
export declare const findNextWordStart: (text: string, currentOffset: number) => number;
|
|
8
|
+
export declare const findPrevWordStart: (text: string, currentOffset: number) => number;
|
|
9
|
+
export declare const findWordEnd: (text: string, currentOffset: number) => number;
|
|
10
|
+
export declare const getOffsetFromPosition: (row: number, col: number, lines: string[]) => number;
|
|
11
|
+
export declare const getPositionFromOffsets: (startOffset: number, endOffset: number, lines: string[]) => {
|
|
12
|
+
startRow: number;
|
|
13
|
+
startCol: number;
|
|
14
|
+
endRow: number;
|
|
15
|
+
endCol: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const getLineRangeOffsets: (startRow: number, lineCount: number, lines: string[]) => {
|
|
18
|
+
startOffset: number;
|
|
19
|
+
endOffset: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const replaceRangeInternal: (state: TextBufferState, startRow: number, startCol: number, endRow: number, endCol: number, text: string) => TextBufferState;
|
|
7
22
|
export interface Viewport {
|
|
8
23
|
height: number;
|
|
9
24
|
width: number;
|
|
@@ -24,7 +39,12 @@ interface UndoHistoryEntry {
|
|
|
24
39
|
cursorCol: number;
|
|
25
40
|
}
|
|
26
41
|
export declare function offsetToLogicalPos(text: string, offset: number): [number, number];
|
|
27
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Converts logical row/col position to absolute text offset
|
|
44
|
+
* Inverse operation of offsetToLogicalPos
|
|
45
|
+
*/
|
|
46
|
+
export declare function logicalPosToOffset(lines: string[], row: number, col: number): number;
|
|
47
|
+
export interface TextBufferState {
|
|
28
48
|
lines: string[];
|
|
29
49
|
cursorRow: number;
|
|
30
50
|
cursorCol: number;
|
|
@@ -35,7 +55,8 @@ interface TextBufferState {
|
|
|
35
55
|
selectionAnchor: [number, number] | null;
|
|
36
56
|
viewportWidth: number;
|
|
37
57
|
}
|
|
38
|
-
|
|
58
|
+
export declare const pushUndo: (currentState: TextBufferState) => TextBufferState;
|
|
59
|
+
export type TextBufferAction = {
|
|
39
60
|
type: 'set_text';
|
|
40
61
|
payload: string;
|
|
41
62
|
pushToUndo?: boolean;
|
|
@@ -82,6 +103,125 @@ type TextBufferAction = {
|
|
|
82
103
|
} | {
|
|
83
104
|
type: 'set_viewport_width';
|
|
84
105
|
payload: number;
|
|
106
|
+
} | {
|
|
107
|
+
type: 'vim_delete_word_forward';
|
|
108
|
+
payload: {
|
|
109
|
+
count: number;
|
|
110
|
+
};
|
|
111
|
+
} | {
|
|
112
|
+
type: 'vim_delete_word_backward';
|
|
113
|
+
payload: {
|
|
114
|
+
count: number;
|
|
115
|
+
};
|
|
116
|
+
} | {
|
|
117
|
+
type: 'vim_delete_word_end';
|
|
118
|
+
payload: {
|
|
119
|
+
count: number;
|
|
120
|
+
};
|
|
121
|
+
} | {
|
|
122
|
+
type: 'vim_change_word_forward';
|
|
123
|
+
payload: {
|
|
124
|
+
count: number;
|
|
125
|
+
};
|
|
126
|
+
} | {
|
|
127
|
+
type: 'vim_change_word_backward';
|
|
128
|
+
payload: {
|
|
129
|
+
count: number;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
type: 'vim_change_word_end';
|
|
133
|
+
payload: {
|
|
134
|
+
count: number;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
type: 'vim_delete_line';
|
|
138
|
+
payload: {
|
|
139
|
+
count: number;
|
|
140
|
+
};
|
|
141
|
+
} | {
|
|
142
|
+
type: 'vim_change_line';
|
|
143
|
+
payload: {
|
|
144
|
+
count: number;
|
|
145
|
+
};
|
|
146
|
+
} | {
|
|
147
|
+
type: 'vim_delete_to_end_of_line';
|
|
148
|
+
} | {
|
|
149
|
+
type: 'vim_change_to_end_of_line';
|
|
150
|
+
} | {
|
|
151
|
+
type: 'vim_change_movement';
|
|
152
|
+
payload: {
|
|
153
|
+
movement: 'h' | 'j' | 'k' | 'l';
|
|
154
|
+
count: number;
|
|
155
|
+
};
|
|
156
|
+
} | {
|
|
157
|
+
type: 'vim_move_left';
|
|
158
|
+
payload: {
|
|
159
|
+
count: number;
|
|
160
|
+
};
|
|
161
|
+
} | {
|
|
162
|
+
type: 'vim_move_right';
|
|
163
|
+
payload: {
|
|
164
|
+
count: number;
|
|
165
|
+
};
|
|
166
|
+
} | {
|
|
167
|
+
type: 'vim_move_up';
|
|
168
|
+
payload: {
|
|
169
|
+
count: number;
|
|
170
|
+
};
|
|
171
|
+
} | {
|
|
172
|
+
type: 'vim_move_down';
|
|
173
|
+
payload: {
|
|
174
|
+
count: number;
|
|
175
|
+
};
|
|
176
|
+
} | {
|
|
177
|
+
type: 'vim_move_word_forward';
|
|
178
|
+
payload: {
|
|
179
|
+
count: number;
|
|
180
|
+
};
|
|
181
|
+
} | {
|
|
182
|
+
type: 'vim_move_word_backward';
|
|
183
|
+
payload: {
|
|
184
|
+
count: number;
|
|
185
|
+
};
|
|
186
|
+
} | {
|
|
187
|
+
type: 'vim_move_word_end';
|
|
188
|
+
payload: {
|
|
189
|
+
count: number;
|
|
190
|
+
};
|
|
191
|
+
} | {
|
|
192
|
+
type: 'vim_delete_char';
|
|
193
|
+
payload: {
|
|
194
|
+
count: number;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
197
|
+
type: 'vim_insert_at_cursor';
|
|
198
|
+
} | {
|
|
199
|
+
type: 'vim_append_at_cursor';
|
|
200
|
+
} | {
|
|
201
|
+
type: 'vim_open_line_below';
|
|
202
|
+
} | {
|
|
203
|
+
type: 'vim_open_line_above';
|
|
204
|
+
} | {
|
|
205
|
+
type: 'vim_append_at_line_end';
|
|
206
|
+
} | {
|
|
207
|
+
type: 'vim_insert_at_line_start';
|
|
208
|
+
} | {
|
|
209
|
+
type: 'vim_move_to_line_start';
|
|
210
|
+
} | {
|
|
211
|
+
type: 'vim_move_to_line_end';
|
|
212
|
+
} | {
|
|
213
|
+
type: 'vim_move_to_first_nonwhitespace';
|
|
214
|
+
} | {
|
|
215
|
+
type: 'vim_move_to_first_line';
|
|
216
|
+
} | {
|
|
217
|
+
type: 'vim_move_to_last_line';
|
|
218
|
+
} | {
|
|
219
|
+
type: 'vim_move_to_line';
|
|
220
|
+
payload: {
|
|
221
|
+
lineNumber: number;
|
|
222
|
+
};
|
|
223
|
+
} | {
|
|
224
|
+
type: 'vim_escape_insert_mode';
|
|
85
225
|
};
|
|
86
226
|
export declare function textBufferReducer(state: TextBufferState, action: TextBufferAction): TextBufferState;
|
|
87
227
|
export declare function useTextBuffer({ initialText, initialCursorOffset, viewport, stdin, setRawMode, onChange, isValidPath, shellModeActive, }: UseTextBufferProps): TextBuffer;
|
|
@@ -182,5 +322,133 @@ export interface TextBuffer {
|
|
|
182
322
|
}) => Promise<void>;
|
|
183
323
|
replaceRangeByOffset: (startOffset: number, endOffset: number, replacementText: string) => void;
|
|
184
324
|
moveToOffset(offset: number): void;
|
|
325
|
+
/**
|
|
326
|
+
* Delete N words forward from cursor position (vim 'dw' command)
|
|
327
|
+
*/
|
|
328
|
+
vimDeleteWordForward: (count: number) => void;
|
|
329
|
+
/**
|
|
330
|
+
* Delete N words backward from cursor position (vim 'db' command)
|
|
331
|
+
*/
|
|
332
|
+
vimDeleteWordBackward: (count: number) => void;
|
|
333
|
+
/**
|
|
334
|
+
* Delete to end of N words from cursor position (vim 'de' command)
|
|
335
|
+
*/
|
|
336
|
+
vimDeleteWordEnd: (count: number) => void;
|
|
337
|
+
/**
|
|
338
|
+
* Change N words forward from cursor position (vim 'cw' command)
|
|
339
|
+
*/
|
|
340
|
+
vimChangeWordForward: (count: number) => void;
|
|
341
|
+
/**
|
|
342
|
+
* Change N words backward from cursor position (vim 'cb' command)
|
|
343
|
+
*/
|
|
344
|
+
vimChangeWordBackward: (count: number) => void;
|
|
345
|
+
/**
|
|
346
|
+
* Change to end of N words from cursor position (vim 'ce' command)
|
|
347
|
+
*/
|
|
348
|
+
vimChangeWordEnd: (count: number) => void;
|
|
349
|
+
/**
|
|
350
|
+
* Delete N lines from cursor position (vim 'dd' command)
|
|
351
|
+
*/
|
|
352
|
+
vimDeleteLine: (count: number) => void;
|
|
353
|
+
/**
|
|
354
|
+
* Change N lines from cursor position (vim 'cc' command)
|
|
355
|
+
*/
|
|
356
|
+
vimChangeLine: (count: number) => void;
|
|
357
|
+
/**
|
|
358
|
+
* Delete from cursor to end of line (vim 'D' command)
|
|
359
|
+
*/
|
|
360
|
+
vimDeleteToEndOfLine: () => void;
|
|
361
|
+
/**
|
|
362
|
+
* Change from cursor to end of line (vim 'C' command)
|
|
363
|
+
*/
|
|
364
|
+
vimChangeToEndOfLine: () => void;
|
|
365
|
+
/**
|
|
366
|
+
* Change movement operations (vim 'ch', 'cj', 'ck', 'cl' commands)
|
|
367
|
+
*/
|
|
368
|
+
vimChangeMovement: (movement: 'h' | 'j' | 'k' | 'l', count: number) => void;
|
|
369
|
+
/**
|
|
370
|
+
* Move cursor left N times (vim 'h' command)
|
|
371
|
+
*/
|
|
372
|
+
vimMoveLeft: (count: number) => void;
|
|
373
|
+
/**
|
|
374
|
+
* Move cursor right N times (vim 'l' command)
|
|
375
|
+
*/
|
|
376
|
+
vimMoveRight: (count: number) => void;
|
|
377
|
+
/**
|
|
378
|
+
* Move cursor up N times (vim 'k' command)
|
|
379
|
+
*/
|
|
380
|
+
vimMoveUp: (count: number) => void;
|
|
381
|
+
/**
|
|
382
|
+
* Move cursor down N times (vim 'j' command)
|
|
383
|
+
*/
|
|
384
|
+
vimMoveDown: (count: number) => void;
|
|
385
|
+
/**
|
|
386
|
+
* Move cursor forward N words (vim 'w' command)
|
|
387
|
+
*/
|
|
388
|
+
vimMoveWordForward: (count: number) => void;
|
|
389
|
+
/**
|
|
390
|
+
* Move cursor backward N words (vim 'b' command)
|
|
391
|
+
*/
|
|
392
|
+
vimMoveWordBackward: (count: number) => void;
|
|
393
|
+
/**
|
|
394
|
+
* Move cursor to end of Nth word (vim 'e' command)
|
|
395
|
+
*/
|
|
396
|
+
vimMoveWordEnd: (count: number) => void;
|
|
397
|
+
/**
|
|
398
|
+
* Delete N characters at cursor (vim 'x' command)
|
|
399
|
+
*/
|
|
400
|
+
vimDeleteChar: (count: number) => void;
|
|
401
|
+
/**
|
|
402
|
+
* Enter insert mode at cursor (vim 'i' command)
|
|
403
|
+
*/
|
|
404
|
+
vimInsertAtCursor: () => void;
|
|
405
|
+
/**
|
|
406
|
+
* Enter insert mode after cursor (vim 'a' command)
|
|
407
|
+
*/
|
|
408
|
+
vimAppendAtCursor: () => void;
|
|
409
|
+
/**
|
|
410
|
+
* Open new line below and enter insert mode (vim 'o' command)
|
|
411
|
+
*/
|
|
412
|
+
vimOpenLineBelow: () => void;
|
|
413
|
+
/**
|
|
414
|
+
* Open new line above and enter insert mode (vim 'O' command)
|
|
415
|
+
*/
|
|
416
|
+
vimOpenLineAbove: () => void;
|
|
417
|
+
/**
|
|
418
|
+
* Move to end of line and enter insert mode (vim 'A' command)
|
|
419
|
+
*/
|
|
420
|
+
vimAppendAtLineEnd: () => void;
|
|
421
|
+
/**
|
|
422
|
+
* Move to first non-whitespace and enter insert mode (vim 'I' command)
|
|
423
|
+
*/
|
|
424
|
+
vimInsertAtLineStart: () => void;
|
|
425
|
+
/**
|
|
426
|
+
* Move cursor to beginning of line (vim '0' command)
|
|
427
|
+
*/
|
|
428
|
+
vimMoveToLineStart: () => void;
|
|
429
|
+
/**
|
|
430
|
+
* Move cursor to end of line (vim '$' command)
|
|
431
|
+
*/
|
|
432
|
+
vimMoveToLineEnd: () => void;
|
|
433
|
+
/**
|
|
434
|
+
* Move cursor to first non-whitespace character (vim '^' command)
|
|
435
|
+
*/
|
|
436
|
+
vimMoveToFirstNonWhitespace: () => void;
|
|
437
|
+
/**
|
|
438
|
+
* Move cursor to first line (vim 'gg' command)
|
|
439
|
+
*/
|
|
440
|
+
vimMoveToFirstLine: () => void;
|
|
441
|
+
/**
|
|
442
|
+
* Move cursor to last line (vim 'G' command)
|
|
443
|
+
*/
|
|
444
|
+
vimMoveToLastLine: () => void;
|
|
445
|
+
/**
|
|
446
|
+
* Move cursor to specific line number (vim '[N]G' command)
|
|
447
|
+
*/
|
|
448
|
+
vimMoveToLine: (lineNumber: number) => void;
|
|
449
|
+
/**
|
|
450
|
+
* Handle escape from insert mode (moves cursor left if not at line start)
|
|
451
|
+
*/
|
|
452
|
+
vimEscapeInsertMode: () => void;
|
|
185
453
|
}
|
|
186
454
|
export {};
|