@codingame/monaco-vscode-chat-service-override 15.0.3 → 16.0.1
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/index.js +11 -8
- package/package.json +29 -20
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +22 -0
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +80 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/{askToSelectPrompt.d.ts → askToSelectPrompt/askToSelectPrompt.d.ts} +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +163 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +22 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +242 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditing.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +688 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +355 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +395 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +831 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +985 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +578 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +320 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +22 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +166 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +6 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +704 -732
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +10 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +329 -236
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +217 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +90 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +65 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +14 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +16 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +175 -57
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +313 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +18 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptPathAutocompletion.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +157 -65
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +39 -21
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +47 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +5 -0
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt.js +0 -142
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -331
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.js +0 -85
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.js +0 -22
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
import { DOCS_OPTION } from './constants.js';
|
|
3
|
+
import { attachPrompts } from './utils/attachPrompts.js';
|
|
4
|
+
import { handleButtonClick } from './utils/handleButtonClick.js';
|
|
5
|
+
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
6
|
+
import { createPromptPickItem } from './utils/createPromptPickItem.js';
|
|
7
|
+
import { createPlaceholderText } from './utils/createPlaceholderText.js';
|
|
8
|
+
import { extUri } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
9
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
10
|
+
|
|
11
|
+
const askToSelectPrompt = async (options) => {
|
|
12
|
+
const { promptFiles, resource, quickInputService, labelService } = options;
|
|
13
|
+
const fileOptions = ( promptFiles.map((promptFile) => {
|
|
14
|
+
return createPromptPickItem(promptFile, labelService);
|
|
15
|
+
}));
|
|
16
|
+
fileOptions.push(DOCS_OPTION);
|
|
17
|
+
let activeItem;
|
|
18
|
+
if (resource) {
|
|
19
|
+
activeItem = fileOptions.find((file) => {
|
|
20
|
+
return extUri.isEqual(file.value, resource);
|
|
21
|
+
});
|
|
22
|
+
if (!activeItem) {
|
|
23
|
+
activeItem = createPromptPickItem({
|
|
24
|
+
uri: resource,
|
|
25
|
+
type: 'local',
|
|
26
|
+
}, labelService);
|
|
27
|
+
fileOptions.push(activeItem);
|
|
28
|
+
}
|
|
29
|
+
fileOptions.sort((file1, file2) => {
|
|
30
|
+
if (extUri.isEqual(file1.value, resource)) {
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
33
|
+
if (extUri.isEqual(file2.value, resource)) {
|
|
34
|
+
return 1;
|
|
35
|
+
}
|
|
36
|
+
return 0;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (!activeItem) {
|
|
40
|
+
activeItem = fileOptions[0];
|
|
41
|
+
}
|
|
42
|
+
const quickPick = quickInputService.createQuickPick();
|
|
43
|
+
quickPick.activeItems = activeItem ? [activeItem] : [];
|
|
44
|
+
quickPick.placeholder = createPlaceholderText(options);
|
|
45
|
+
quickPick.canAcceptInBackground = true;
|
|
46
|
+
quickPick.matchOnDescription = true;
|
|
47
|
+
quickPick.items = fileOptions;
|
|
48
|
+
const { openerService } = options;
|
|
49
|
+
return await ( new Promise(resolve => {
|
|
50
|
+
const disposables = ( new DisposableStore());
|
|
51
|
+
let lastActiveWidget = options.widget;
|
|
52
|
+
disposables.add({
|
|
53
|
+
dispose() {
|
|
54
|
+
quickPick.dispose();
|
|
55
|
+
resolve();
|
|
56
|
+
lastActiveWidget?.focusInput();
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
disposables.add(quickPick.onDidAccept(async (event) => {
|
|
60
|
+
const { selectedItems } = quickPick;
|
|
61
|
+
assert(selectedItems.length === 1, `Only one item can be accepted, got '${selectedItems.length}'.`);
|
|
62
|
+
const selectedOption = selectedItems[0];
|
|
63
|
+
const docsSelected = (selectedOption === DOCS_OPTION);
|
|
64
|
+
if (docsSelected) {
|
|
65
|
+
await openerService.open(selectedOption.value);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
lastActiveWidget = await attachPrompts(selectedItems, options, quickPick.keyMods);
|
|
69
|
+
if (!event.inBackground) {
|
|
70
|
+
disposables.dispose();
|
|
71
|
+
}
|
|
72
|
+
}));
|
|
73
|
+
disposables.add(quickPick.onDidTriggerItemButton(handleButtonClick.bind(null, { quickPick, ...options })));
|
|
74
|
+
disposables.add(quickPick.onDidHide(disposables.dispose.bind(disposables)));
|
|
75
|
+
quickPick.show();
|
|
76
|
+
}));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export { askToSelectPrompt };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { WithUriValue } from "@codingame/monaco-vscode-api/vscode/vs/base/common/types";
|
|
2
|
+
import { IQuickInputButton, IQuickPickItem } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
3
|
+
export declare const SUPER_KEY_NAME: string;
|
|
4
|
+
export declare const ALT_KEY_NAME: string;
|
|
5
|
+
export declare const DOCS_OPTION: WithUriValue<IQuickPickItem>;
|
|
6
|
+
export declare const EDIT_BUTTON: IQuickInputButton;
|
|
7
|
+
export declare const DELETE_BUTTON: IQuickInputButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
6
|
+
import { DOCUMENTATION_URL } from '../../../../../common/promptSyntax/constants.js';
|
|
7
|
+
import { isWindows, isLinux } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
8
|
+
|
|
9
|
+
const SUPER_KEY_NAME = (isWindows || isLinux) ? 'Ctrl' : '⌘';
|
|
10
|
+
const ALT_KEY_NAME = (isWindows || isLinux) ? 'Alt' : '⌥';
|
|
11
|
+
const DOCS_OPTION = ( Object.freeze({
|
|
12
|
+
type: 'item',
|
|
13
|
+
label: ( localize(4357, 'Learn how to create reusable prompts')),
|
|
14
|
+
description: DOCUMENTATION_URL,
|
|
15
|
+
tooltip: DOCUMENTATION_URL,
|
|
16
|
+
value: ( URI.parse(DOCUMENTATION_URL)),
|
|
17
|
+
}));
|
|
18
|
+
const EDIT_BUTTON = ( Object.freeze({
|
|
19
|
+
tooltip: ( localize(4358, "edit ({0}-key + enter)", SUPER_KEY_NAME)),
|
|
20
|
+
iconClass: ThemeIcon.asClassName(Codicon.edit),
|
|
21
|
+
}));
|
|
22
|
+
const DELETE_BUTTON = ( Object.freeze({
|
|
23
|
+
tooltip: ( localize(4359, "delete")),
|
|
24
|
+
iconClass: ThemeIcon.asClassName(Codicon.trash),
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
export { ALT_KEY_NAME, DELETE_BUTTON, DOCS_OPTION, EDIT_BUTTON, SUPER_KEY_NAME };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ISelectPromptOptions } from "../askToSelectPrompt.js";
|
|
2
|
+
import { IChatWidget } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
3
|
+
import { WithUriValue } from "@codingame/monaco-vscode-api/vscode/vs/base/common/types";
|
|
4
|
+
import { IKeyMods, IQuickPickItem } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
5
|
+
export declare const attachPrompts: (files: readonly WithUriValue<IQuickPickItem>[], options: ISelectPromptOptions, keyMods: IKeyMods) => Promise<IChatWidget>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
|
|
2
|
+
import { showChatView, showEditsView } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
3
|
+
import { assertDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
4
|
+
import { ACTION_ID_NEW_CHAT, ACTION_ID_NEW_EDIT_SESSION } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/actions/chatClearActions';
|
|
5
|
+
|
|
6
|
+
const attachPrompts = async (files, options, keyMods) => {
|
|
7
|
+
const widget = await getChatWidgetObject(options, keyMods);
|
|
8
|
+
for (const file of files) {
|
|
9
|
+
widget
|
|
10
|
+
.attachmentModel
|
|
11
|
+
.promptInstructions
|
|
12
|
+
.add(file.value);
|
|
13
|
+
}
|
|
14
|
+
return widget;
|
|
15
|
+
};
|
|
16
|
+
const getChatWidgetObject = async (options, keyMods) => {
|
|
17
|
+
const { widget } = options;
|
|
18
|
+
const { alt, ctrlCmd } = keyMods;
|
|
19
|
+
if (ctrlCmd) {
|
|
20
|
+
return await openNewChat(options, alt);
|
|
21
|
+
}
|
|
22
|
+
if (!widget) {
|
|
23
|
+
return await showExistingChat(options, alt);
|
|
24
|
+
}
|
|
25
|
+
return widget;
|
|
26
|
+
};
|
|
27
|
+
const openNewChat = async (options, edits) => {
|
|
28
|
+
const { commandService, chatService, viewsService } = options;
|
|
29
|
+
if (chatService.unifiedViewEnabled === true) {
|
|
30
|
+
await commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
31
|
+
const widget = await showChatView(viewsService);
|
|
32
|
+
assertDefined(widget, 'Chat widget must be defined.');
|
|
33
|
+
return widget;
|
|
34
|
+
}
|
|
35
|
+
(edits === true)
|
|
36
|
+
? await commandService.executeCommand(ACTION_ID_NEW_EDIT_SESSION)
|
|
37
|
+
: await commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
38
|
+
const widget = (edits === true)
|
|
39
|
+
? await showEditsView(viewsService)
|
|
40
|
+
: await showChatView(viewsService);
|
|
41
|
+
assertDefined(widget, 'Chat widget must be defined.');
|
|
42
|
+
return widget;
|
|
43
|
+
};
|
|
44
|
+
const showExistingChat = async (options, edits) => {
|
|
45
|
+
const { chatService, viewsService } = options;
|
|
46
|
+
const widget = (edits && (chatService.unifiedViewEnabled === false))
|
|
47
|
+
? await showEditsView(viewsService)
|
|
48
|
+
: await showChatView(viewsService);
|
|
49
|
+
assertDefined(widget, 'Revealed chat widget must be defined.');
|
|
50
|
+
return widget;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export { attachPrompts };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { SUPER_KEY_NAME, ALT_KEY_NAME } from '../constants.js';
|
|
4
|
+
|
|
5
|
+
const createPlaceholderText = (options) => {
|
|
6
|
+
const { widget, chatService } = options;
|
|
7
|
+
let text = ( localize(4360, 'Select a prompt to use'));
|
|
8
|
+
if (widget === undefined) {
|
|
9
|
+
const superModifierNote = ( localize(4361, '{0}-key to use in new chat', SUPER_KEY_NAME));
|
|
10
|
+
const altOptionModifierNote = ( localize(4362, ' or {0}-key to use in Copilot Edits', ALT_KEY_NAME));
|
|
11
|
+
const openInEditsNote = (chatService.unifiedViewEnabled === true)
|
|
12
|
+
? ''
|
|
13
|
+
: altOptionModifierNote;
|
|
14
|
+
text += ( localize(4363, ' (hold {0}{1})', superModifierNote, openInEditsNote));
|
|
15
|
+
}
|
|
16
|
+
return text;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { createPlaceholderText };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { WithUriValue } from "@codingame/monaco-vscode-api/vscode/vs/base/common/types";
|
|
2
|
+
import { IPromptPath } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/types";
|
|
3
|
+
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
4
|
+
import { IQuickPickItem } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
5
|
+
export declare const createPromptPickItem: (promptFile: IPromptPath, labelService: ILabelService) => WithUriValue<IQuickPickItem>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { EDIT_BUTTON, DELETE_BUTTON } from '../constants.js';
|
|
4
|
+
import { dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
|
+
import { getCleanPromptName } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
6
|
+
|
|
7
|
+
const createPromptPickItem = (promptFile, labelService) => {
|
|
8
|
+
const { uri, type } = promptFile;
|
|
9
|
+
const fileWithoutExtension = getCleanPromptName(uri);
|
|
10
|
+
const description = (type === 'user')
|
|
11
|
+
? ( localize(4364, 'User prompt'))
|
|
12
|
+
: labelService.getUriLabel(dirname(uri), { relative: true });
|
|
13
|
+
const tooltip = (type === 'user')
|
|
14
|
+
? description
|
|
15
|
+
: uri.fsPath;
|
|
16
|
+
return {
|
|
17
|
+
id: ( uri.toString()),
|
|
18
|
+
type: 'item',
|
|
19
|
+
label: fileWithoutExtension,
|
|
20
|
+
description,
|
|
21
|
+
tooltip,
|
|
22
|
+
value: uri,
|
|
23
|
+
buttons: [EDIT_BUTTON, DELETE_BUTTON],
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { createPromptPickItem };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WithUriValue } from "@codingame/monaco-vscode-api/vscode/vs/base/common/types";
|
|
2
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
3
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
4
|
+
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
5
|
+
import { IQuickPick, IQuickPickItem, IQuickPickItemButtonEvent } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput";
|
|
6
|
+
interface IHandleButtonClickOptions {
|
|
7
|
+
quickPick: IQuickPick<WithUriValue<IQuickPickItem>>;
|
|
8
|
+
fileService: IFileService;
|
|
9
|
+
openerService: IOpenerService;
|
|
10
|
+
dialogService: IDialogService;
|
|
11
|
+
}
|
|
12
|
+
export declare function handleButtonClick(options: IHandleButtonClickOptions, context: IQuickPickItemButtonEvent<WithUriValue<IQuickPickItem>>): Promise<boolean | undefined>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { EDIT_BUTTON, DELETE_BUTTON } from '../constants.js';
|
|
4
|
+
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
5
|
+
import { getCleanPromptName } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
6
|
+
|
|
7
|
+
async function handleButtonClick(options, context) {
|
|
8
|
+
const { quickPick, openerService, fileService, dialogService } = options;
|
|
9
|
+
const { item, button } = context;
|
|
10
|
+
const { value } = item;
|
|
11
|
+
if (button === EDIT_BUTTON) {
|
|
12
|
+
return await openerService.open(value);
|
|
13
|
+
}
|
|
14
|
+
if (button === DELETE_BUTTON) {
|
|
15
|
+
assert((quickPick.activeItems.length < 2), `Expected maximum one active item, got '${quickPick.activeItems.length}'.`);
|
|
16
|
+
const activeItem = quickPick.activeItems[0];
|
|
17
|
+
const info = await fileService.stat(value);
|
|
18
|
+
assert(info.isDirectory === false, `'${value.fsPath}' points to a folder.`);
|
|
19
|
+
const previousIgnoreFocusOut = quickPick.ignoreFocusOut;
|
|
20
|
+
quickPick.ignoreFocusOut = true;
|
|
21
|
+
const filename = getCleanPromptName(value);
|
|
22
|
+
const { confirmed } = await dialogService.confirm({
|
|
23
|
+
message: ( localize(4365, "Are you sure you want to delete '{0}'?", filename)),
|
|
24
|
+
});
|
|
25
|
+
quickPick.ignoreFocusOut = previousIgnoreFocusOut;
|
|
26
|
+
if (!confirmed) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await fileService.del(value);
|
|
30
|
+
let removedIndex = -1;
|
|
31
|
+
quickPick.items = quickPick.items.filter((option, index) => {
|
|
32
|
+
if (option === item) {
|
|
33
|
+
removedIndex = index;
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
return true;
|
|
37
|
+
});
|
|
38
|
+
if (activeItem && (activeItem === item)) {
|
|
39
|
+
assert(removedIndex >= 0, 'Removed item index must be a valid index.');
|
|
40
|
+
const newActiveItemIndex = Math.max(removedIndex - 1, 0);
|
|
41
|
+
const newActiveItem = quickPick.items[newActiveItemIndex];
|
|
42
|
+
quickPick.activeItems = newActiveItem ? [newActiveItem] : [];
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
throw ( new Error(`Unknown button '${JSON.stringify(button)}'.`));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { handleButtonClick };
|
|
@@ -22,11 +22,11 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
22
22
|
import { accessibleViewInCodeBlock } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
23
23
|
import { reviewEdits } from '@codingame/monaco-vscode-29bc1406-2925-5b8f-b25e-d04a7772d896-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
24
24
|
import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
25
|
-
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
26
25
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
27
26
|
import { ChatCopyKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
28
27
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
29
28
|
import { isResponseVM } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
29
|
+
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
30
30
|
import { IChatWidgetService, IChatCodeBlockContextProviderService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
31
31
|
import { DefaultChatTextEditor } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart';
|
|
32
32
|
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
@@ -81,7 +81,7 @@ let CodeBlockActionRendering = class CodeBlockActionRendering extends Disposable
|
|
|
81
81
|
const context = this._context;
|
|
82
82
|
if (isCodeBlockActionContext(context) && context.codemapperUri) {
|
|
83
83
|
const label = labelService.getUriLabel(context.codemapperUri, { relative: true });
|
|
84
|
-
return localize(
|
|
84
|
+
return localize(4372, "Apply to {0}", label);
|
|
85
85
|
}
|
|
86
86
|
return super.getTooltip();
|
|
87
87
|
}
|
|
@@ -104,7 +104,7 @@ function registerChatCodeBlockActions() {
|
|
|
104
104
|
constructor() {
|
|
105
105
|
super({
|
|
106
106
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
107
|
-
title: ( localize2(
|
|
107
|
+
title: ( localize2(4373, "Copy")),
|
|
108
108
|
f1: false,
|
|
109
109
|
category: CHAT_CATEGORY,
|
|
110
110
|
icon: Codicon.copy,
|
|
@@ -189,7 +189,7 @@ function registerChatCodeBlockActions() {
|
|
|
189
189
|
constructor() {
|
|
190
190
|
super({
|
|
191
191
|
id: APPLY_IN_EDITOR_ID,
|
|
192
|
-
title: ( localize2(
|
|
192
|
+
title: ( localize2(4374, "Apply in Editor")),
|
|
193
193
|
precondition: ChatContextKeys.enabled,
|
|
194
194
|
f1: true,
|
|
195
195
|
category: CHAT_CATEGORY,
|
|
@@ -225,7 +225,7 @@ function registerChatCodeBlockActions() {
|
|
|
225
225
|
constructor() {
|
|
226
226
|
super({
|
|
227
227
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
228
|
-
title: ( localize2(
|
|
228
|
+
title: ( localize2(4375, "Insert At Cursor")),
|
|
229
229
|
precondition: ChatContextKeys.enabled,
|
|
230
230
|
f1: true,
|
|
231
231
|
category: CHAT_CATEGORY,
|
|
@@ -259,7 +259,7 @@ function registerChatCodeBlockActions() {
|
|
|
259
259
|
constructor() {
|
|
260
260
|
super({
|
|
261
261
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
262
|
-
title: ( localize2(
|
|
262
|
+
title: ( localize2(4376, "Insert into New File")),
|
|
263
263
|
precondition: ChatContextKeys.enabled,
|
|
264
264
|
f1: true,
|
|
265
265
|
category: CHAT_CATEGORY,
|
|
@@ -300,7 +300,7 @@ function registerChatCodeBlockActions() {
|
|
|
300
300
|
constructor() {
|
|
301
301
|
super({
|
|
302
302
|
id: 'workbench.action.chat.runInTerminal',
|
|
303
|
-
title: ( localize2(
|
|
303
|
+
title: ( localize2(4377, "Insert into Terminal")),
|
|
304
304
|
precondition: ChatContextKeys.enabled,
|
|
305
305
|
f1: true,
|
|
306
306
|
category: CHAT_CATEGORY,
|
|
@@ -394,7 +394,7 @@ function registerChatCodeBlockActions() {
|
|
|
394
394
|
constructor() {
|
|
395
395
|
super({
|
|
396
396
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
397
|
-
title: ( localize2(
|
|
397
|
+
title: ( localize2(4378, "Next Code Block")),
|
|
398
398
|
keybinding: {
|
|
399
399
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown,
|
|
400
400
|
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown, },
|
|
@@ -414,7 +414,7 @@ function registerChatCodeBlockActions() {
|
|
|
414
414
|
constructor() {
|
|
415
415
|
super({
|
|
416
416
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
417
|
-
title: ( localize2(
|
|
417
|
+
title: ( localize2(4379, "Previous Code Block")),
|
|
418
418
|
keybinding: {
|
|
419
419
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp,
|
|
420
420
|
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp, },
|
|
@@ -472,7 +472,7 @@ function registerChatCodeCompareBlockActions() {
|
|
|
472
472
|
constructor() {
|
|
473
473
|
super({
|
|
474
474
|
id: 'workbench.action.chat.applyCompareEdits',
|
|
475
|
-
title: ( localize2(
|
|
475
|
+
title: ( localize2(4380, "Apply Edits")),
|
|
476
476
|
f1: false,
|
|
477
477
|
category: CHAT_CATEGORY,
|
|
478
478
|
icon: Codicon.gitPullRequestGoToChanges,
|
|
@@ -514,7 +514,7 @@ function registerChatCodeCompareBlockActions() {
|
|
|
514
514
|
constructor() {
|
|
515
515
|
super({
|
|
516
516
|
id: 'workbench.action.chat.discardCompareEdits',
|
|
517
|
-
title: ( localize2(
|
|
517
|
+
title: ( localize2(4381, "Discard Edits")),
|
|
518
518
|
f1: false,
|
|
519
519
|
category: CHAT_CATEGORY,
|
|
520
520
|
icon: Codicon.trash,
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions";
|
|
2
2
|
import { Action2, IAction2Options } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
3
3
|
export declare function registerChatContextActions(): void;
|
|
4
|
+
export declare class AttachSearchResultAction extends Action2 {
|
|
5
|
+
static readonly Name = "searchResults";
|
|
6
|
+
static readonly ID = "workbench.action.chat.insertSearchResults";
|
|
7
|
+
constructor();
|
|
8
|
+
run(accessor: ServicesAccessor, ...args: any[]): Promise<void>;
|
|
9
|
+
}
|
|
4
10
|
export declare class AttachContextAction extends Action2 {
|
|
5
11
|
static readonly ID = "workbench.action.chat.attachContext";
|
|
6
|
-
protected static _cdt: import("@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey").ContextKeyExpression | undefined;
|
|
7
12
|
constructor(desc?: Readonly<IAction2Options>);
|
|
8
13
|
private _getFileContextId;
|
|
9
14
|
private _attachContext;
|