@vybestack/llxprt-code 0.1.15 → 0.1.16
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 +37 -2
- package/dist/package.json +3 -3
- package/dist/src/config/config.d.ts +4 -1
- package/dist/src/config/config.js +151 -54
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/settings.d.ts +11 -2
- package/dist/src/config/settings.js +84 -23
- package/dist/src/config/settings.js.map +1 -1
- package/dist/src/gemini.d.ts +2 -0
- package/dist/src/gemini.js +177 -21
- 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/generated/git-commit.js.map +1 -1
- package/dist/src/integration-tests/GITHUB_ACTIONS_README.md +41 -0
- package/dist/src/integration-tests/test-utils.d.ts +68 -0
- package/dist/src/integration-tests/test-utils.js +167 -0
- package/dist/src/integration-tests/test-utils.js.map +1 -0
- package/dist/src/nonInteractiveCli.js +24 -66
- package/dist/src/nonInteractiveCli.js.map +1 -1
- package/dist/src/providers/IFileSystem.d.ts +42 -0
- package/dist/src/providers/IFileSystem.js +46 -0
- package/dist/src/providers/IFileSystem.js.map +1 -0
- package/dist/src/providers/providerConfigUtils.d.ts +0 -4
- package/dist/src/providers/providerConfigUtils.js +21 -52
- package/dist/src/providers/providerConfigUtils.js.map +1 -1
- package/dist/src/providers/providerManagerInstance.d.ts +6 -1
- package/dist/src/providers/providerManagerInstance.js +117 -82
- package/dist/src/providers/providerManagerInstance.js.map +1 -1
- package/dist/src/services/BuiltinCommandLoader.js +11 -0
- package/dist/src/services/BuiltinCommandLoader.js.map +1 -1
- package/dist/src/ui/App.js +61 -48
- package/dist/src/ui/App.js.map +1 -1
- package/dist/src/ui/commands/aboutCommand.js +2 -5
- package/dist/src/ui/commands/aboutCommand.js.map +1 -1
- package/dist/src/ui/commands/baseurlCommand.js +54 -9
- package/dist/src/ui/commands/baseurlCommand.js.map +1 -1
- package/dist/src/ui/commands/diagnosticsCommand.d.ts +10 -0
- package/dist/src/ui/commands/diagnosticsCommand.js +122 -0
- package/dist/src/ui/commands/diagnosticsCommand.js.map +1 -0
- 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.js +63 -31
- package/dist/src/ui/commands/initCommand.js.map +1 -1
- package/dist/src/ui/commands/keyCommand.js +75 -11
- package/dist/src/ui/commands/keyCommand.js.map +1 -1
- package/dist/src/ui/commands/keyfileCommand.js +54 -13
- package/dist/src/ui/commands/keyfileCommand.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/modelCommand.js +2 -5
- package/dist/src/ui/commands/modelCommand.js.map +1 -1
- package/dist/src/ui/commands/profileCommand.d.ts +10 -0
- package/dist/src/ui/commands/profileCommand.js +592 -0
- package/dist/src/ui/commands/profileCommand.js.map +1 -0
- package/dist/src/ui/commands/providerCommand.js +46 -3
- package/dist/src/ui/commands/providerCommand.js.map +1 -1
- package/dist/src/ui/commands/setCommand.d.ts +7 -0
- package/dist/src/ui/commands/setCommand.js +431 -0
- package/dist/src/ui/commands/setCommand.js.map +1 -0
- 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 +1 -1
- package/dist/src/ui/commands/types.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 +5 -4
- package/dist/src/ui/components/Footer.js.map +1 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.d.ts +2 -1
- package/dist/src/ui/components/IDEContextDetailDisplay.js +3 -3
- package/dist/src/ui/components/IDEContextDetailDisplay.js.map +1 -1
- package/dist/src/ui/components/InputPrompt.js +123 -12
- package/dist/src/ui/components/InputPrompt.js.map +1 -1
- package/dist/src/ui/components/LoadProfileDialog.d.ts +13 -0
- package/dist/src/ui/components/LoadProfileDialog.js +57 -0
- package/dist/src/ui/components/LoadProfileDialog.js.map +1 -0
- package/dist/src/ui/components/PrepareLabel.d.ts +15 -0
- package/dist/src/ui/components/PrepareLabel.js +16 -0
- package/dist/src/ui/components/PrepareLabel.js.map +1 -0
- package/dist/src/ui/components/ProviderModelDialog.js +75 -28
- package/dist/src/ui/components/ProviderModelDialog.js.map +1 -1
- package/dist/src/ui/components/SecureKeyInput.d.ts +15 -0
- package/dist/src/ui/components/SecureKeyInput.js +58 -0
- package/dist/src/ui/components/SecureKeyInput.js.map +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.d.ts +1 -0
- package/dist/src/ui/components/SuggestionsDisplay.js +3 -3
- package/dist/src/ui/components/SuggestionsDisplay.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.js +9 -14
- package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
- package/dist/src/ui/containers/SessionController.js +14 -15
- package/dist/src/ui/containers/SessionController.js.map +1 -1
- package/dist/src/ui/editors/editorSettingsManager.js +2 -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/slashCommandProcessor.d.ts +1 -1
- package/dist/src/ui/hooks/slashCommandProcessor.js +13 -3
- package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
- package/dist/src/ui/hooks/useAuthCommand.js +9 -0
- package/dist/src/ui/hooks/useAuthCommand.js.map +1 -1
- package/dist/src/ui/hooks/useCompletion.d.ts +5 -5
- package/dist/src/ui/hooks/useCompletion.js +7 -407
- package/dist/src/ui/hooks/useCompletion.js.map +1 -1
- package/dist/src/ui/hooks/useGeminiStream.js +44 -10
- package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
- package/dist/src/ui/hooks/useLoadProfileDialog.d.ts +27 -0
- package/dist/src/ui/hooks/useLoadProfileDialog.js +138 -0
- package/dist/src/ui/hooks/useLoadProfileDialog.js.map +1 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.d.ts +19 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js +54 -0
- package/dist/src/ui/hooks/useReverseSearchCompletion.js.map +1 -0
- package/dist/src/ui/hooks/useShellHistory.d.ts +1 -0
- package/dist/src/ui/hooks/useShellHistory.js +30 -7
- package/dist/src/ui/hooks/useShellHistory.js.map +1 -1
- package/dist/src/ui/hooks/useSlashCompletion.d.ts +24 -0
- package/dist/src/ui/hooks/useSlashCompletion.js +451 -0
- package/dist/src/ui/hooks/useSlashCompletion.js.map +1 -0
- package/dist/src/ui/reducers/appReducer.d.ts +3 -2
- package/dist/src/ui/reducers/appReducer.js +1 -0
- package/dist/src/ui/reducers/appReducer.js.map +1 -1
- package/dist/src/ui/utils/renderLoopDetector.js +3 -3
- package/dist/src/ui/utils/renderLoopDetector.js.map +1 -1
- package/dist/src/ui/utils/secureInputHandler.d.ts +46 -0
- package/dist/src/ui/utils/secureInputHandler.js +128 -0
- package/dist/src/ui/utils/secureInputHandler.js.map +1 -0
- package/dist/src/ui/utils/updateCheck.js +57 -12
- package/dist/src/ui/utils/updateCheck.js.map +1 -1
- 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 +2 -1
- package/dist/src/utils/handleAutoUpdate.js +8 -4
- package/dist/src/utils/handleAutoUpdate.js.map +1 -1
- 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 +35 -11
- package/dist/src/utils/sandbox.js.map +1 -1
- package/dist/src/utils/spawnWrapper.d.ts +7 -0
- package/dist/src/utils/spawnWrapper.js +8 -0
- package/dist/src/utils/spawnWrapper.js.map +1 -0
- package/dist/src/validateNonInterActiveAuth.d.ts +2 -1
- package/dist/src/validateNonInterActiveAuth.js +31 -5
- package/dist/src/validateNonInterActiveAuth.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/dist/src/providers/enhanceConfigWithProviders.d.ts +0 -12
- package/dist/src/providers/enhanceConfigWithProviders.js +0 -16
- package/dist/src/providers/enhanceConfigWithProviders.js.map +0 -1
@@ -13,10 +13,11 @@ import { CommandService } from '../../services/CommandService.js';
|
|
13
13
|
import { BuiltinCommandLoader } from '../../services/BuiltinCommandLoader.js';
|
14
14
|
import { FileCommandLoader } from '../../services/FileCommandLoader.js';
|
15
15
|
import { McpPromptLoader } from '../../services/McpPromptLoader.js';
|
16
|
+
import { secureInputHandler } from '../utils/secureInputHandler.js';
|
16
17
|
/**
|
17
18
|
* Hook to define and process slash commands (e.g., /help, /clear).
|
18
19
|
*/
|
19
|
-
export const useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHistory, refreshStatic, setShowHelp, onDebugMessage, openThemeDialog, openAuthDialog, openEditorDialog, openProviderDialog, openProviderModelDialog, toggleCorgiMode, setQuittingMessages, openPrivacyNotice, toggleVimEnabled, setIsProcessing) => {
|
20
|
+
export const useSlashCommandProcessor = (config, settings, addItem, clearItems, loadHistory, refreshStatic, setShowHelp, onDebugMessage, openThemeDialog, openAuthDialog, openEditorDialog, openProviderDialog, openProviderModelDialog, openLoadProfileDialog, toggleCorgiMode, setQuittingMessages, openPrivacyNotice, toggleVimEnabled, setIsProcessing) => {
|
20
21
|
const session = useSessionStats();
|
21
22
|
const [commands, setCommands] = useState([]);
|
22
23
|
const [shellConfirmationRequest, setShellConfirmationRequest] = useState(null);
|
@@ -135,6 +136,7 @@ export const useSlashCommandProcessor = (config, settings, addItem, clearItems,
|
|
135
136
|
toggleVimEnabled,
|
136
137
|
sessionShellAllowlist,
|
137
138
|
]);
|
139
|
+
const ideMode = config?.getIdeMode();
|
138
140
|
useEffect(() => {
|
139
141
|
const controller = new AbortController();
|
140
142
|
const load = async () => {
|
@@ -150,7 +152,7 @@ export const useSlashCommandProcessor = (config, settings, addItem, clearItems,
|
|
150
152
|
return () => {
|
151
153
|
controller.abort();
|
152
154
|
};
|
153
|
-
}, [config]);
|
155
|
+
}, [config, ideMode]);
|
154
156
|
const handleSlashCommand = useCallback(async (rawQuery, oneTimeShellAllowlist) => {
|
155
157
|
setIsProcessing(true);
|
156
158
|
try {
|
@@ -162,7 +164,11 @@ export const useSlashCommandProcessor = (config, settings, addItem, clearItems,
|
|
162
164
|
return false;
|
163
165
|
}
|
164
166
|
const userMessageTimestamp = Date.now();
|
165
|
-
|
167
|
+
// Sanitize the command if it contains sensitive data
|
168
|
+
const sanitizedCommand = trimmed.startsWith('/key ')
|
169
|
+
? secureInputHandler.sanitizeForHistory(trimmed)
|
170
|
+
: trimmed;
|
171
|
+
addItem({ type: MessageType.USER, text: sanitizedCommand }, userMessageTimestamp);
|
166
172
|
const parts = trimmed.substring(1).trim().split(/\s+/);
|
167
173
|
const commandPath = parts.filter((p) => p); // The parts of the command, e.g., ['memory', 'add']
|
168
174
|
let currentCommands = commands;
|
@@ -266,6 +272,9 @@ export const useSlashCommandProcessor = (config, settings, addItem, clearItems,
|
|
266
272
|
case 'providerModel':
|
267
273
|
openProviderModelDialog();
|
268
274
|
return { type: 'handled' };
|
275
|
+
case 'loadProfile':
|
276
|
+
openLoadProfileDialog();
|
277
|
+
return { type: 'handled' };
|
269
278
|
default: {
|
270
279
|
const unhandled = result.dialog;
|
271
280
|
throw new Error(`Unhandled slash command result: ${unhandled}`);
|
@@ -375,6 +384,7 @@ export const useSlashCommandProcessor = (config, settings, addItem, clearItems,
|
|
375
384
|
openEditorDialog,
|
376
385
|
openProviderDialog,
|
377
386
|
openProviderModelDialog,
|
387
|
+
openLoadProfileDialog,
|
378
388
|
setQuittingMessages,
|
379
389
|
setShellConfirmationRequest,
|
380
390
|
setSessionShellAllowlist,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slashCommandProcessor.js","sourceRoot":"","sources":["../../../../src/ui/hooks/slashCommandProcessor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAEL,UAAU,EACV,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAEL,WAAW,GAIZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAA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iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,mBAAmB;QACnB,2BAA2B;QAC3B,wBAAwB;QACxB,eAAe;KAChB,CACF,CAAC;IAEF,OAAO;QACL,kBAAkB;QAClB,aAAa,EAAE,QAAQ;QACvB,mBAAmB;QACnB,cAAc;QACd,wBAAwB;KACzB,CAAC;AACJ,CAAC,CAAC"}
|
1
|
+
{"version":3,"file":"slashCommandProcessor.js","sourceRoot":"","sources":["../../../../src/ui/hooks/slashCommandProcessor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,OAAO,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAEL,UAAU,EACV,MAAM,EACN,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAEL,WAAW,GAIZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,MAAqB,EACrB,QAAwB,EACxB,OAA2C,EAC3C,UAAiD,EACjD,WAAmD,EACnD,aAAyB,EACzB,WAA0D,EAC1D,cAAyC,EACzC,eAA2B,EAC3B,cAA0B,EAC1B,gBAA4B,EAC5B,kBAA8B,EAC9B,uBAAmC,E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ACd,QAAQ;QACR,cAAc;QACd,UAAU;QACV,eAAe;QACf,iBAAiB;QACjB,gBAAgB;QAChB,kBAAkB;QAClB,uBAAuB;QACvB,qBAAqB;QACrB,mBAAmB;QACnB,2BAA2B;QAC3B,wBAAwB;QACxB,eAAe;KAChB,CACF,CAAC;IAEF,OAAO;QACL,kBAAkB;QAClB,aAAa,EAAE,QAAQ;QACvB,mBAAmB;QACnB,cAAc;QACd,wBAAwB;KACzB,CAAC;AACJ,CAAC,CAAC"}
|
@@ -31,6 +31,15 @@ export const useAuthCommand = (settings, appState, config) => {
|
|
31
31
|
try {
|
32
32
|
setIsAuthenticating(true);
|
33
33
|
await config.refreshAuth(authType);
|
34
|
+
// Apply compression settings after authentication
|
35
|
+
const contextLimit = config.getEphemeralSetting('context-limit');
|
36
|
+
const compressionThreshold = config.getEphemeralSetting('compression-threshold');
|
37
|
+
if (contextLimit || compressionThreshold) {
|
38
|
+
const geminiClient = config.getGeminiClient();
|
39
|
+
if (geminiClient) {
|
40
|
+
geminiClient.setCompressionSettings(compressionThreshold, contextLimit);
|
41
|
+
}
|
42
|
+
}
|
34
43
|
// Update serverToolsProvider after authentication
|
35
44
|
const providerManager = getProviderManager();
|
36
45
|
if (providerManager) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useAuthCommand.js","sourceRoot":"","sources":["../../../../src/ui/hooks/useAuthCommand.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EACL,QAAQ,EAER,yBAAyB,EACzB,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAEhF,MAAM,CAAC,MAAM,cAAc,GA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+3,7 @@
|
|
3
3
|
* Copyright 2025 Google LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
5
|
*/
|
6
|
-
import { Config } from '@vybestack/llxprt-code-core';
|
7
6
|
import { Suggestion } from '../components/SuggestionsDisplay.js';
|
8
|
-
import { CommandContext, SlashCommand } from '../commands/types.js';
|
9
|
-
import { TextBuffer } from '../components/shared/text-buffer.js';
|
10
7
|
export interface UseCompletionReturn {
|
11
8
|
suggestions: Suggestion[];
|
12
9
|
activeSuggestionIndex: number;
|
@@ -14,11 +11,14 @@ export interface UseCompletionReturn {
|
|
14
11
|
showSuggestions: boolean;
|
15
12
|
isLoadingSuggestions: boolean;
|
16
13
|
isPerfectMatch: boolean;
|
14
|
+
setSuggestions: React.Dispatch<React.SetStateAction<Suggestion[]>>;
|
17
15
|
setActiveSuggestionIndex: React.Dispatch<React.SetStateAction<number>>;
|
16
|
+
setVisibleStartIndex: React.Dispatch<React.SetStateAction<number>>;
|
17
|
+
setIsLoadingSuggestions: React.Dispatch<React.SetStateAction<boolean>>;
|
18
|
+
setIsPerfectMatch: React.Dispatch<React.SetStateAction<boolean>>;
|
18
19
|
setShowSuggestions: React.Dispatch<React.SetStateAction<boolean>>;
|
19
20
|
resetCompletionState: () => void;
|
20
21
|
navigateUp: () => void;
|
21
22
|
navigateDown: () => void;
|
22
|
-
handleAutocomplete: (indexToUse: number) => void;
|
23
23
|
}
|
24
|
-
export declare function useCompletion(
|
24
|
+
export declare function useCompletion(): UseCompletionReturn;
|
@@ -3,15 +3,9 @@
|
|
3
3
|
* Copyright 2025 Google LLC
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
5
5
|
*/
|
6
|
-
import { useState,
|
7
|
-
import * as fs from 'fs/promises';
|
8
|
-
import * as path from 'path';
|
9
|
-
import { glob } from 'glob';
|
10
|
-
import { isNodeError, escapePath, unescapePath, getErrorMessage, DEFAULT_FILE_FILTERING_OPTIONS, } from '@vybestack/llxprt-code-core';
|
6
|
+
import { useState, useCallback } from 'react';
|
11
7
|
import { MAX_SUGGESTIONS_TO_SHOW, } from '../components/SuggestionsDisplay.js';
|
12
|
-
|
13
|
-
import { toCodePoints } from '../utils/textUtils.js';
|
14
|
-
export function useCompletion(buffer, cwd, slashCommands, commandContext, config) {
|
8
|
+
export function useCompletion() {
|
15
9
|
const [suggestions, setSuggestions] = useState([]);
|
16
10
|
const [activeSuggestionIndex, setActiveSuggestionIndex] = useState(-1);
|
17
11
|
const [visibleStartIndex, setVisibleStartIndex] = useState(0);
|
@@ -73,403 +67,6 @@ export function useCompletion(buffer, cwd, slashCommands, commandContext, config
|
|
73
67
|
return newActiveIndex;
|
74
68
|
});
|
75
69
|
}, [suggestions.length]);
|
76
|
-
// Check if cursor is after @ or / without unescaped spaces
|
77
|
-
const isActive = useMemo(() => {
|
78
|
-
if (isSlashCommand(buffer.text.trim())) {
|
79
|
-
return true;
|
80
|
-
}
|
81
|
-
// For other completions like '@', we search backwards from the cursor.
|
82
|
-
const [row, col] = buffer.cursor;
|
83
|
-
const currentLine = buffer.lines[row] || '';
|
84
|
-
const codePoints = toCodePoints(currentLine);
|
85
|
-
for (let i = col - 1; i >= 0; i--) {
|
86
|
-
const char = codePoints[i];
|
87
|
-
if (char === ' ') {
|
88
|
-
// Check for unescaped spaces.
|
89
|
-
let backslashCount = 0;
|
90
|
-
for (let j = i - 1; j >= 0 && codePoints[j] === '\\'; j--) {
|
91
|
-
backslashCount++;
|
92
|
-
}
|
93
|
-
if (backslashCount % 2 === 0) {
|
94
|
-
return false; // Inactive on unescaped space.
|
95
|
-
}
|
96
|
-
}
|
97
|
-
else if (char === '@') {
|
98
|
-
// Active if we find an '@' before any unescaped space.
|
99
|
-
return true;
|
100
|
-
}
|
101
|
-
}
|
102
|
-
return false;
|
103
|
-
}, [buffer.text, buffer.cursor, buffer.lines]);
|
104
|
-
useEffect(() => {
|
105
|
-
if (!isActive) {
|
106
|
-
resetCompletionState();
|
107
|
-
return;
|
108
|
-
}
|
109
|
-
const trimmedQuery = buffer.text.trimStart();
|
110
|
-
if (trimmedQuery.startsWith('/')) {
|
111
|
-
// Always reset perfect match at the beginning of processing.
|
112
|
-
setIsPerfectMatch(false);
|
113
|
-
const fullPath = trimmedQuery.substring(1);
|
114
|
-
const hasTrailingSpace = trimmedQuery.endsWith(' ');
|
115
|
-
// Get all non-empty parts of the command.
|
116
|
-
const rawParts = fullPath.split(/\s+/).filter((p) => p);
|
117
|
-
let commandPathParts = rawParts;
|
118
|
-
let partial = '';
|
119
|
-
// If there's no trailing space, the last part is potentially a partial segment.
|
120
|
-
// We tentatively separate it.
|
121
|
-
if (!hasTrailingSpace && rawParts.length > 0) {
|
122
|
-
partial = rawParts[rawParts.length - 1];
|
123
|
-
commandPathParts = rawParts.slice(0, -1);
|
124
|
-
}
|
125
|
-
// Traverse the Command Tree using the tentative completed path
|
126
|
-
let currentLevel = slashCommands;
|
127
|
-
let leafCommand = null;
|
128
|
-
for (const part of commandPathParts) {
|
129
|
-
if (!currentLevel) {
|
130
|
-
leafCommand = null;
|
131
|
-
currentLevel = [];
|
132
|
-
break;
|
133
|
-
}
|
134
|
-
const found = currentLevel.find((cmd) => cmd.name === part || cmd.altNames?.includes(part));
|
135
|
-
if (found) {
|
136
|
-
leafCommand = found;
|
137
|
-
currentLevel = found.subCommands;
|
138
|
-
}
|
139
|
-
else {
|
140
|
-
leafCommand = null;
|
141
|
-
currentLevel = [];
|
142
|
-
break;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
// Handle the Ambiguous Case
|
146
|
-
if (!hasTrailingSpace && currentLevel) {
|
147
|
-
const exactMatchAsParent = currentLevel.find((cmd) => (cmd.name === partial || cmd.altNames?.includes(partial)) &&
|
148
|
-
cmd.subCommands);
|
149
|
-
if (exactMatchAsParent) {
|
150
|
-
// It's a perfect match for a parent command. Override our initial guess.
|
151
|
-
// Treat it as a completed command path.
|
152
|
-
leafCommand = exactMatchAsParent;
|
153
|
-
currentLevel = exactMatchAsParent.subCommands;
|
154
|
-
partial = ''; // We now want to suggest ALL of its sub-commands.
|
155
|
-
}
|
156
|
-
}
|
157
|
-
// Check for perfect, executable match
|
158
|
-
if (!hasTrailingSpace) {
|
159
|
-
if (leafCommand && partial === '' && leafCommand.action) {
|
160
|
-
// Case: /command<enter> - command has action, no sub-commands were suggested
|
161
|
-
setIsPerfectMatch(true);
|
162
|
-
}
|
163
|
-
else if (currentLevel) {
|
164
|
-
// Case: /command subcommand<enter>
|
165
|
-
const perfectMatch = currentLevel.find((cmd) => (cmd.name === partial || cmd.altNames?.includes(partial)) &&
|
166
|
-
cmd.action);
|
167
|
-
if (perfectMatch) {
|
168
|
-
setIsPerfectMatch(true);
|
169
|
-
}
|
170
|
-
}
|
171
|
-
}
|
172
|
-
const depth = commandPathParts.length;
|
173
|
-
// Provide Suggestions based on the now-corrected context
|
174
|
-
// Argument Completion
|
175
|
-
if (leafCommand?.completion &&
|
176
|
-
(hasTrailingSpace ||
|
177
|
-
(rawParts.length > depth && depth > 0 && partial !== ''))) {
|
178
|
-
const fetchAndSetSuggestions = async () => {
|
179
|
-
setIsLoadingSuggestions(true);
|
180
|
-
const argString = rawParts.slice(depth).join(' ');
|
181
|
-
const results = (await leafCommand.completion(commandContext, argString)) || [];
|
182
|
-
const finalSuggestions = results.map((s) => ({ label: s, value: s }));
|
183
|
-
setSuggestions(finalSuggestions);
|
184
|
-
setShowSuggestions(finalSuggestions.length > 0);
|
185
|
-
setActiveSuggestionIndex(finalSuggestions.length > 0 ? 0 : -1);
|
186
|
-
setIsLoadingSuggestions(false);
|
187
|
-
};
|
188
|
-
fetchAndSetSuggestions();
|
189
|
-
return;
|
190
|
-
}
|
191
|
-
// Command/Sub-command Completion
|
192
|
-
const commandsToSearch = currentLevel || [];
|
193
|
-
if (commandsToSearch.length > 0) {
|
194
|
-
let potentialSuggestions = commandsToSearch.filter((cmd) => cmd.description &&
|
195
|
-
(cmd.name.startsWith(partial) ||
|
196
|
-
cmd.altNames?.some((alt) => alt.startsWith(partial))));
|
197
|
-
// If a user's input is an exact match and it is a leaf command,
|
198
|
-
// enter should submit immediately.
|
199
|
-
if (potentialSuggestions.length > 0 && !hasTrailingSpace) {
|
200
|
-
const perfectMatch = potentialSuggestions.find((s) => s.name === partial || s.altNames?.includes(partial));
|
201
|
-
if (perfectMatch && perfectMatch.action) {
|
202
|
-
potentialSuggestions = [];
|
203
|
-
}
|
204
|
-
}
|
205
|
-
const finalSuggestions = potentialSuggestions.map((cmd) => ({
|
206
|
-
label: cmd.name,
|
207
|
-
value: cmd.name,
|
208
|
-
description: cmd.description,
|
209
|
-
}));
|
210
|
-
setSuggestions(finalSuggestions);
|
211
|
-
setShowSuggestions(finalSuggestions.length > 0);
|
212
|
-
setActiveSuggestionIndex(finalSuggestions.length > 0 ? 0 : -1);
|
213
|
-
setIsLoadingSuggestions(false);
|
214
|
-
return;
|
215
|
-
}
|
216
|
-
// If we fall through, no suggestions are available.
|
217
|
-
resetCompletionState();
|
218
|
-
return;
|
219
|
-
}
|
220
|
-
// Handle At Command Completion
|
221
|
-
const atIndex = buffer.text.lastIndexOf('@');
|
222
|
-
if (atIndex === -1) {
|
223
|
-
resetCompletionState();
|
224
|
-
return;
|
225
|
-
}
|
226
|
-
const partialPath = buffer.text.substring(atIndex + 1);
|
227
|
-
const lastSlashIndex = partialPath.lastIndexOf('/');
|
228
|
-
const baseDirRelative = lastSlashIndex === -1
|
229
|
-
? '.'
|
230
|
-
: partialPath.substring(0, lastSlashIndex + 1);
|
231
|
-
const prefix = unescapePath(lastSlashIndex === -1
|
232
|
-
? partialPath
|
233
|
-
: partialPath.substring(lastSlashIndex + 1));
|
234
|
-
const baseDirAbsolute = path.resolve(cwd, baseDirRelative);
|
235
|
-
let isMounted = true;
|
236
|
-
const findFilesRecursively = async (startDir, searchPrefix, fileDiscovery, filterOptions, currentRelativePath = '', depth = 0, maxDepth = 10, // Limit recursion depth
|
237
|
-
maxResults = 50) => {
|
238
|
-
if (depth > maxDepth) {
|
239
|
-
return [];
|
240
|
-
}
|
241
|
-
const lowerSearchPrefix = searchPrefix.toLowerCase();
|
242
|
-
let foundSuggestions = [];
|
243
|
-
try {
|
244
|
-
const entries = await fs.readdir(startDir, { withFileTypes: true });
|
245
|
-
for (const entry of entries) {
|
246
|
-
if (foundSuggestions.length >= maxResults)
|
247
|
-
break;
|
248
|
-
const entryPathRelative = path.join(currentRelativePath, entry.name);
|
249
|
-
const entryPathFromRoot = path.relative(cwd, path.join(startDir, entry.name));
|
250
|
-
// Conditionally ignore dotfiles
|
251
|
-
if (!searchPrefix.startsWith('.') && entry.name.startsWith('.')) {
|
252
|
-
continue;
|
253
|
-
}
|
254
|
-
// Check if this entry should be ignored by filtering options
|
255
|
-
if (fileDiscovery &&
|
256
|
-
fileDiscovery.shouldIgnoreFile(entryPathFromRoot, filterOptions)) {
|
257
|
-
continue;
|
258
|
-
}
|
259
|
-
if (entry.name.toLowerCase().startsWith(lowerSearchPrefix)) {
|
260
|
-
foundSuggestions.push({
|
261
|
-
label: entryPathRelative + (entry.isDirectory() ? '/' : ''),
|
262
|
-
value: escapePath(entryPathRelative + (entry.isDirectory() ? '/' : '')),
|
263
|
-
});
|
264
|
-
}
|
265
|
-
if (entry.isDirectory() &&
|
266
|
-
entry.name !== 'node_modules' &&
|
267
|
-
!entry.name.startsWith('.')) {
|
268
|
-
if (foundSuggestions.length < maxResults) {
|
269
|
-
foundSuggestions = foundSuggestions.concat(await findFilesRecursively(path.join(startDir, entry.name), searchPrefix, // Pass original searchPrefix for recursive calls
|
270
|
-
fileDiscovery, filterOptions, entryPathRelative, depth + 1, maxDepth, maxResults - foundSuggestions.length));
|
271
|
-
}
|
272
|
-
}
|
273
|
-
}
|
274
|
-
}
|
275
|
-
catch (_err) {
|
276
|
-
// Ignore errors like permission denied or ENOENT during recursive search
|
277
|
-
}
|
278
|
-
return foundSuggestions.slice(0, maxResults);
|
279
|
-
};
|
280
|
-
const findFilesWithGlob = async (searchPrefix, fileDiscoveryService, filterOptions, maxResults = 50) => {
|
281
|
-
const globPattern = `**/${searchPrefix}*`;
|
282
|
-
const files = await glob(globPattern, {
|
283
|
-
cwd,
|
284
|
-
dot: searchPrefix.startsWith('.'),
|
285
|
-
nocase: true,
|
286
|
-
});
|
287
|
-
const suggestions = files
|
288
|
-
.map((file) => ({
|
289
|
-
label: file,
|
290
|
-
value: escapePath(file),
|
291
|
-
}))
|
292
|
-
.filter((s) => {
|
293
|
-
if (fileDiscoveryService) {
|
294
|
-
return !fileDiscoveryService.shouldIgnoreFile(s.label, filterOptions); // relative path
|
295
|
-
}
|
296
|
-
return true;
|
297
|
-
})
|
298
|
-
.slice(0, maxResults);
|
299
|
-
return suggestions;
|
300
|
-
};
|
301
|
-
const fetchSuggestions = async () => {
|
302
|
-
setIsLoadingSuggestions(true);
|
303
|
-
let fetchedSuggestions = [];
|
304
|
-
const fileDiscoveryService = config ? config.getFileService() : null;
|
305
|
-
const enableRecursiveSearch = config?.getEnableRecursiveFileSearch() ?? true;
|
306
|
-
const filterOptions = config?.getFileFilteringOptions() ?? DEFAULT_FILE_FILTERING_OPTIONS;
|
307
|
-
try {
|
308
|
-
// If there's no slash, or it's the root, do a recursive search from cwd
|
309
|
-
if (partialPath.indexOf('/') === -1 &&
|
310
|
-
prefix &&
|
311
|
-
enableRecursiveSearch) {
|
312
|
-
if (fileDiscoveryService) {
|
313
|
-
fetchedSuggestions = await findFilesWithGlob(prefix, fileDiscoveryService, filterOptions);
|
314
|
-
}
|
315
|
-
else {
|
316
|
-
fetchedSuggestions = await findFilesRecursively(cwd, prefix, null, filterOptions);
|
317
|
-
}
|
318
|
-
}
|
319
|
-
else {
|
320
|
-
// Original behavior: list files in the specific directory
|
321
|
-
const lowerPrefix = prefix.toLowerCase();
|
322
|
-
const entries = await fs.readdir(baseDirAbsolute, {
|
323
|
-
withFileTypes: true,
|
324
|
-
});
|
325
|
-
// Filter entries using git-aware filtering
|
326
|
-
const filteredEntries = [];
|
327
|
-
for (const entry of entries) {
|
328
|
-
// Conditionally ignore dotfiles
|
329
|
-
if (!prefix.startsWith('.') && entry.name.startsWith('.')) {
|
330
|
-
continue;
|
331
|
-
}
|
332
|
-
if (!entry.name.toLowerCase().startsWith(lowerPrefix))
|
333
|
-
continue;
|
334
|
-
const relativePath = path.relative(cwd, path.join(baseDirAbsolute, entry.name));
|
335
|
-
if (fileDiscoveryService &&
|
336
|
-
fileDiscoveryService.shouldIgnoreFile(relativePath, filterOptions)) {
|
337
|
-
continue;
|
338
|
-
}
|
339
|
-
filteredEntries.push(entry);
|
340
|
-
}
|
341
|
-
fetchedSuggestions = filteredEntries.map((entry) => {
|
342
|
-
const label = entry.isDirectory() ? entry.name + '/' : entry.name;
|
343
|
-
return {
|
344
|
-
label,
|
345
|
-
value: escapePath(label), // Value for completion should be just the name part
|
346
|
-
};
|
347
|
-
});
|
348
|
-
}
|
349
|
-
// Like glob, we always return forwardslashes, even in windows.
|
350
|
-
fetchedSuggestions = fetchedSuggestions.map((suggestion) => ({
|
351
|
-
...suggestion,
|
352
|
-
label: suggestion.label.replace(/\\/g, '/'),
|
353
|
-
value: suggestion.value.replace(/\\/g, '/'),
|
354
|
-
}));
|
355
|
-
// Sort by depth, then directories first, then alphabetically
|
356
|
-
fetchedSuggestions.sort((a, b) => {
|
357
|
-
const depthA = (a.label.match(/\//g) || []).length;
|
358
|
-
const depthB = (b.label.match(/\//g) || []).length;
|
359
|
-
if (depthA !== depthB) {
|
360
|
-
return depthA - depthB;
|
361
|
-
}
|
362
|
-
const aIsDir = a.label.endsWith('/');
|
363
|
-
const bIsDir = b.label.endsWith('/');
|
364
|
-
if (aIsDir && !bIsDir)
|
365
|
-
return -1;
|
366
|
-
if (!aIsDir && bIsDir)
|
367
|
-
return 1;
|
368
|
-
// exclude extension when comparing
|
369
|
-
const filenameA = a.label.substring(0, a.label.length - path.extname(a.label).length);
|
370
|
-
const filenameB = b.label.substring(0, b.label.length - path.extname(b.label).length);
|
371
|
-
return (filenameA.localeCompare(filenameB) || a.label.localeCompare(b.label));
|
372
|
-
});
|
373
|
-
if (isMounted) {
|
374
|
-
setSuggestions(fetchedSuggestions);
|
375
|
-
setShowSuggestions(fetchedSuggestions.length > 0);
|
376
|
-
setActiveSuggestionIndex(fetchedSuggestions.length > 0 ? 0 : -1);
|
377
|
-
setVisibleStartIndex(0);
|
378
|
-
}
|
379
|
-
}
|
380
|
-
catch (error) {
|
381
|
-
if (isNodeError(error) && error.code === 'ENOENT') {
|
382
|
-
if (isMounted) {
|
383
|
-
setSuggestions([]);
|
384
|
-
setShowSuggestions(false);
|
385
|
-
}
|
386
|
-
}
|
387
|
-
else {
|
388
|
-
console.error(`Error fetching completion suggestions for ${partialPath}: ${getErrorMessage(error)}`);
|
389
|
-
if (isMounted) {
|
390
|
-
resetCompletionState();
|
391
|
-
}
|
392
|
-
}
|
393
|
-
}
|
394
|
-
if (isMounted) {
|
395
|
-
setIsLoadingSuggestions(false);
|
396
|
-
}
|
397
|
-
};
|
398
|
-
const debounceTimeout = setTimeout(fetchSuggestions, 100);
|
399
|
-
return () => {
|
400
|
-
isMounted = false;
|
401
|
-
clearTimeout(debounceTimeout);
|
402
|
-
};
|
403
|
-
}, [
|
404
|
-
buffer.text,
|
405
|
-
cwd,
|
406
|
-
isActive,
|
407
|
-
resetCompletionState,
|
408
|
-
slashCommands,
|
409
|
-
commandContext,
|
410
|
-
config,
|
411
|
-
]);
|
412
|
-
const handleAutocomplete = useCallback((indexToUse) => {
|
413
|
-
if (indexToUse < 0 || indexToUse >= suggestions.length) {
|
414
|
-
return;
|
415
|
-
}
|
416
|
-
const query = buffer.text;
|
417
|
-
const suggestion = suggestions[indexToUse].value;
|
418
|
-
if (query.trimStart().startsWith('/')) {
|
419
|
-
const hasTrailingSpace = query.endsWith(' ');
|
420
|
-
const parts = query
|
421
|
-
.trimStart()
|
422
|
-
.substring(1)
|
423
|
-
.split(/\s+/)
|
424
|
-
.filter(Boolean);
|
425
|
-
let isParentPath = false;
|
426
|
-
// If there's no trailing space, we need to check if the current query
|
427
|
-
// is already a complete path to a parent command.
|
428
|
-
if (!hasTrailingSpace) {
|
429
|
-
let currentLevel = slashCommands;
|
430
|
-
for (let i = 0; i < parts.length; i++) {
|
431
|
-
const part = parts[i];
|
432
|
-
const found = currentLevel?.find((cmd) => cmd.name === part || cmd.altNames?.includes(part));
|
433
|
-
if (found) {
|
434
|
-
if (i === parts.length - 1 && found.subCommands) {
|
435
|
-
isParentPath = true;
|
436
|
-
}
|
437
|
-
currentLevel = found.subCommands;
|
438
|
-
}
|
439
|
-
else {
|
440
|
-
// Path is invalid, so it can't be a parent path.
|
441
|
-
currentLevel = undefined;
|
442
|
-
break;
|
443
|
-
}
|
444
|
-
}
|
445
|
-
}
|
446
|
-
// Determine the base path of the command.
|
447
|
-
// - If there's a trailing space, the whole command is the base.
|
448
|
-
// - If it's a known parent path, the whole command is the base.
|
449
|
-
// - If the last part is a complete argument, the whole command is the base.
|
450
|
-
// - Otherwise, the base is everything EXCEPT the last partial part.
|
451
|
-
const lastPart = parts.length > 0 ? parts[parts.length - 1] : '';
|
452
|
-
const isLastPartACompleteArg = lastPart.startsWith('--') && lastPart.includes('=');
|
453
|
-
const basePath = hasTrailingSpace || isParentPath || isLastPartACompleteArg
|
454
|
-
? parts
|
455
|
-
: parts.slice(0, -1);
|
456
|
-
const newValue = `/${[...basePath, suggestion].join(' ')} `;
|
457
|
-
buffer.setText(newValue);
|
458
|
-
}
|
459
|
-
else {
|
460
|
-
const atIndex = query.lastIndexOf('@');
|
461
|
-
if (atIndex === -1)
|
462
|
-
return;
|
463
|
-
const pathPart = query.substring(atIndex + 1);
|
464
|
-
const lastSlashIndexInPath = pathPart.lastIndexOf('/');
|
465
|
-
let autoCompleteStartIndex = atIndex + 1;
|
466
|
-
if (lastSlashIndexInPath !== -1) {
|
467
|
-
autoCompleteStartIndex += lastSlashIndexInPath + 1;
|
468
|
-
}
|
469
|
-
buffer.replaceRangeByOffset(autoCompleteStartIndex, buffer.text.length, suggestion);
|
470
|
-
}
|
471
|
-
resetCompletionState();
|
472
|
-
}, [resetCompletionState, buffer, suggestions, slashCommands]);
|
473
70
|
return {
|
474
71
|
suggestions,
|
475
72
|
activeSuggestionIndex,
|
@@ -477,12 +74,15 @@ export function useCompletion(buffer, cwd, slashCommands, commandContext, config
|
|
477
74
|
showSuggestions,
|
478
75
|
isLoadingSuggestions,
|
479
76
|
isPerfectMatch,
|
480
|
-
|
77
|
+
setSuggestions,
|
481
78
|
setShowSuggestions,
|
79
|
+
setActiveSuggestionIndex,
|
80
|
+
setVisibleStartIndex,
|
81
|
+
setIsLoadingSuggestions,
|
82
|
+
setIsPerfectMatch,
|
482
83
|
resetCompletionState,
|
483
84
|
navigateUp,
|
484
85
|
navigateDown,
|
485
|
-
handleAutocomplete,
|
486
86
|
};
|
487
87
|
}
|
488
88
|
//# sourceMappingURL=useCompletion.js.map
|