@codingame/monaco-vscode-chat-service-override 15.0.2 → 16.0.0
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
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js
CHANGED
|
@@ -7,9 +7,9 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
7
7
|
|
|
8
8
|
let TextModelPromptParser = class TextModelPromptParser extends BasePromptParser {
|
|
9
9
|
constructor(model, seenReferences = [], initService, logService) {
|
|
10
|
-
const contentsProvider = initService.createInstance(TextModelContentsProvider, model)
|
|
11
|
-
.onDispose(() => this.dispose());
|
|
10
|
+
const contentsProvider = initService.createInstance(TextModelContentsProvider, model);
|
|
12
11
|
super(contentsProvider, seenReferences, initService, logService);
|
|
12
|
+
this._register(contentsProvider);
|
|
13
13
|
}
|
|
14
14
|
toString() {
|
|
15
15
|
return `text-model-prompt:${this.uri.path}`;
|
|
@@ -28,9 +28,9 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
28
28
|
async listPromptFiles() {
|
|
29
29
|
const userLocations = [this.userDataService.currentProfile.promptsHome];
|
|
30
30
|
const prompts = await Promise.all([
|
|
31
|
-
this.fileLocator.listFilesIn(userLocations
|
|
31
|
+
this.fileLocator.listFilesIn(userLocations)
|
|
32
32
|
.then(withType('user')),
|
|
33
|
-
this.fileLocator.listFiles(
|
|
33
|
+
this.fileLocator.listFiles()
|
|
34
34
|
.then(withType('local')),
|
|
35
35
|
]);
|
|
36
36
|
return prompts.flat();
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts
CHANGED
|
@@ -4,11 +4,13 @@ import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs
|
|
|
4
4
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
5
|
export declare class PromptFilesLocator {
|
|
6
6
|
private readonly fileService;
|
|
7
|
-
private readonly workspaceService;
|
|
8
7
|
private readonly configService;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
private readonly workspaceService;
|
|
9
|
+
constructor(fileService: IFileService, configService: IConfigurationService, workspaceService: IWorkspaceContextService);
|
|
10
|
+
listFiles(): Promise<readonly URI[]>;
|
|
11
|
+
listFilesIn(folders: readonly URI[]): Promise<readonly URI[]>;
|
|
12
12
|
getConfigBasedSourceFolders(): readonly URI[];
|
|
13
13
|
private findInstructionFiles;
|
|
14
14
|
}
|
|
15
|
+
export declare const isValidGlob: (pattern: string) => boolean;
|
|
16
|
+
export declare const firstNonGlobParent: (location: URI) => URI;
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js
CHANGED
|
@@ -1,101 +1,193 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
+
import { match } from '@codingame/monaco-vscode-api/vscode/vs/base/common/glob';
|
|
5
|
+
import { assert } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
6
|
+
import { isAbsolute } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
4
7
|
import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
5
|
-
import { extUri, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
6
8
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
7
|
-
import { PromptsConfig } from '@codingame/monaco-vscode-
|
|
8
|
-
import {
|
|
9
|
+
import { PromptsConfig } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/config';
|
|
10
|
+
import { basename, extUri, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
9
11
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
10
12
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
13
|
+
import { PROMPT_FILE_EXTENSION, isPromptFile } from '@codingame/monaco-vscode-a1eb43d5-da63-5f76-8ad4-acf0d6c3b749-common/vscode/vs/platform/prompts/common/constants';
|
|
11
14
|
|
|
12
15
|
let PromptFilesLocator = class PromptFilesLocator {
|
|
13
|
-
constructor(fileService,
|
|
16
|
+
constructor(fileService, configService, workspaceService) {
|
|
14
17
|
this.fileService = fileService;
|
|
15
|
-
this.workspaceService = workspaceService;
|
|
16
18
|
this.configService = configService;
|
|
19
|
+
this.workspaceService = workspaceService;
|
|
17
20
|
}
|
|
18
|
-
async listFiles(
|
|
19
|
-
|
|
21
|
+
async listFiles() {
|
|
22
|
+
const configuredLocations = PromptsConfig.promptSourceFolders(this.configService);
|
|
23
|
+
const absoluteLocations = toAbsoluteLocations(configuredLocations, this.workspaceService);
|
|
24
|
+
return await this.listFilesIn(absoluteLocations);
|
|
20
25
|
}
|
|
21
|
-
async listFilesIn(folders
|
|
22
|
-
|
|
23
|
-
for (const excludeUri of exclude) {
|
|
24
|
-
excludeSet.add(excludeUri.path);
|
|
25
|
-
}
|
|
26
|
-
const cleanFolders = folders
|
|
27
|
-
.filter((folder) => {
|
|
28
|
-
return !( excludeSet.has(folder.path));
|
|
29
|
-
});
|
|
30
|
-
return await this.findInstructionFiles(cleanFolders, excludeSet);
|
|
26
|
+
async listFilesIn(folders) {
|
|
27
|
+
return await this.findInstructionFiles(folders);
|
|
31
28
|
}
|
|
32
29
|
getConfigBasedSourceFolders() {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
const configuredLocations = PromptsConfig.promptSourceFolders(this.configService);
|
|
31
|
+
const absoluteLocations = toAbsoluteLocations(configuredLocations, this.workspaceService);
|
|
32
|
+
const result = ( new ResourceSet());
|
|
33
|
+
for (const absoluteLocation of absoluteLocations) {
|
|
34
|
+
let { path } = absoluteLocation;
|
|
35
|
+
const baseName = basename(absoluteLocation);
|
|
36
|
+
const filePatterns = ['*.md', `*${PROMPT_FILE_EXTENSION}`];
|
|
37
|
+
for (const filePattern of filePatterns) {
|
|
38
|
+
if (baseName === filePattern) {
|
|
39
|
+
path = URI.joinPath(absoluteLocation, '..').path;
|
|
39
40
|
continue;
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
}
|
|
43
|
+
if (baseName === '*') {
|
|
44
|
+
path = URI.joinPath(absoluteLocation, '..').path;
|
|
45
|
+
}
|
|
46
|
+
if (isValidGlob(path) === true) {
|
|
42
47
|
continue;
|
|
43
48
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
result.add(URI.file(path));
|
|
50
|
+
}
|
|
51
|
+
return [...result];
|
|
52
|
+
}
|
|
53
|
+
async findInstructionFiles(absoluteLocations) {
|
|
54
|
+
const paths = ( new ResourceSet());
|
|
55
|
+
for (const absoluteLocation of absoluteLocations) {
|
|
56
|
+
assert(isAbsolute(absoluteLocation.path), `Provided location must be an absolute path, got '${absoluteLocation.path}'.`);
|
|
57
|
+
const location = (isValidGlob(basename(absoluteLocation)) || absoluteLocation.path.endsWith(PROMPT_FILE_EXTENSION))
|
|
58
|
+
? absoluteLocation
|
|
59
|
+
: extUri.joinPath(absoluteLocation, `*${PROMPT_FILE_EXTENSION}`);
|
|
60
|
+
const promptFiles = await findAllPromptFiles(firstNonGlobParent(location), this.fileService);
|
|
61
|
+
for (const file of promptFiles) {
|
|
62
|
+
if (match(location.path, file.path)) {
|
|
63
|
+
paths.add(file);
|
|
49
64
|
}
|
|
50
|
-
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return [...paths];
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
PromptFilesLocator = ( __decorate([
|
|
71
|
+
( __param(0, IFileService)),
|
|
72
|
+
( __param(1, IConfigurationService)),
|
|
73
|
+
( __param(2, IWorkspaceContextService))
|
|
74
|
+
], PromptFilesLocator));
|
|
75
|
+
const isValidGlob = (pattern) => {
|
|
76
|
+
let squareBrackets = false;
|
|
77
|
+
let squareBracketsCount = 0;
|
|
78
|
+
let curlyBrackets = false;
|
|
79
|
+
let curlyBracketsCount = 0;
|
|
80
|
+
let previousCharacter;
|
|
81
|
+
for (const char of pattern) {
|
|
82
|
+
if (previousCharacter === '\\') {
|
|
83
|
+
previousCharacter = char;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (char === '*') {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
if (char === '?') {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (char === '[') {
|
|
93
|
+
squareBrackets = true;
|
|
94
|
+
squareBracketsCount++;
|
|
95
|
+
previousCharacter = char;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (char === ']') {
|
|
99
|
+
squareBrackets = true;
|
|
100
|
+
squareBracketsCount--;
|
|
101
|
+
previousCharacter = char;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (char === '{') {
|
|
105
|
+
curlyBrackets = true;
|
|
106
|
+
curlyBracketsCount++;
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
if (char === '}') {
|
|
110
|
+
curlyBrackets = true;
|
|
111
|
+
curlyBracketsCount--;
|
|
112
|
+
previousCharacter = char;
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
previousCharacter = char;
|
|
116
|
+
}
|
|
117
|
+
if (squareBrackets && (squareBracketsCount === 0)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
if (curlyBrackets && (curlyBracketsCount === 0)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
};
|
|
125
|
+
const firstNonGlobParent = (location) => {
|
|
126
|
+
assert(isAbsolute(location.path), `Provided location must be an absolute path, got '${location.path}'.`);
|
|
127
|
+
if (isValidGlob(location.path) === false) {
|
|
128
|
+
return location;
|
|
129
|
+
}
|
|
130
|
+
const parent = dirname(location);
|
|
131
|
+
if (extUri.isEqual(parent, location)) {
|
|
132
|
+
return location;
|
|
133
|
+
}
|
|
134
|
+
return firstNonGlobParent(parent);
|
|
135
|
+
};
|
|
136
|
+
const findAllPromptFiles = async (location, fileService) => {
|
|
137
|
+
const result = [];
|
|
138
|
+
try {
|
|
139
|
+
const info = await fileService.resolve(location);
|
|
140
|
+
if (info.isFile && isPromptFile(info.resource)) {
|
|
141
|
+
result.push(info.resource);
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
if (info.isDirectory && info.children) {
|
|
145
|
+
for (const child of info.children) {
|
|
146
|
+
if (child.isFile && isPromptFile(child.resource)) {
|
|
147
|
+
result.push(child.resource);
|
|
51
148
|
continue;
|
|
52
149
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
150
|
+
if (child.isDirectory) {
|
|
151
|
+
const promptFiles = await findAllPromptFiles(child.resource, fileService);
|
|
152
|
+
result.push(...promptFiles);
|
|
56
153
|
continue;
|
|
57
154
|
}
|
|
58
|
-
if (workspaceFolderUri.fsPath.startsWith(folder.uri.fsPath)) {
|
|
59
|
-
paths.add(workspaceFolderUri);
|
|
60
|
-
}
|
|
61
155
|
}
|
|
156
|
+
return result;
|
|
62
157
|
}
|
|
63
|
-
return [...paths];
|
|
64
158
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
159
|
+
catch (error) {
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
};
|
|
163
|
+
const toAbsoluteLocations = (configuredLocations, workspaceService) => {
|
|
164
|
+
const result = ( new ResourceSet());
|
|
165
|
+
const { folders } = workspaceService.getWorkspace();
|
|
166
|
+
for (const configuredLocation of configuredLocations) {
|
|
167
|
+
if (isAbsolute(configuredLocation)) {
|
|
168
|
+
result.add(URI.file(configuredLocation));
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
for (const workspaceFolder of folders) {
|
|
172
|
+
const absolutePath = extUri.resolvePath(workspaceFolder.uri, configuredLocation);
|
|
173
|
+
assert(isAbsolute(absolutePath.path), `Provided location must be an absolute path, got '${absolutePath.path}'.`);
|
|
174
|
+
if (( result.has(absolutePath)) === false) {
|
|
175
|
+
result.add(absolutePath);
|
|
176
|
+
}
|
|
177
|
+
if (folders.length <= 1) {
|
|
73
178
|
continue;
|
|
74
179
|
}
|
|
75
|
-
|
|
180
|
+
const workspaceRootUri = dirname(workspaceFolder.uri);
|
|
181
|
+
const workspaceFolderUri = extUri.resolvePath(workspaceRootUri, configuredLocation);
|
|
182
|
+
if (( result.has(workspaceFolderUri)) === true) {
|
|
76
183
|
continue;
|
|
77
184
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (isDirectory) {
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (!isPromptFile(resource)) {
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
if (( exclude.has(resource.path))) {
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
files.push(resource);
|
|
185
|
+
if (workspaceFolderUri.fsPath.startsWith(workspaceFolder.uri.fsPath)) {
|
|
186
|
+
result.add(workspaceFolderUri);
|
|
90
187
|
}
|
|
91
188
|
}
|
|
92
|
-
return files;
|
|
93
189
|
}
|
|
190
|
+
return [...result];
|
|
94
191
|
};
|
|
95
|
-
PromptFilesLocator = ( __decorate([
|
|
96
|
-
( __param(0, IFileService)),
|
|
97
|
-
( __param(1, IWorkspaceContextService)),
|
|
98
|
-
( __param(2, IConfigurationService))
|
|
99
|
-
], PromptFilesLocator));
|
|
100
192
|
|
|
101
|
-
export { PromptFilesLocator };
|
|
193
|
+
export { PromptFilesLocator, firstNonGlobParent, isValidGlob };
|
package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IJSONSchema } from "@codingame/monaco-vscode-api/vscode/vs/base/common/jsonSchema";
|
|
2
2
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
3
|
+
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
3
4
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
4
5
|
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service";
|
|
5
6
|
export interface IRawToolContribution {
|
|
@@ -20,5 +21,5 @@ export interface IRawToolContribution {
|
|
|
20
21
|
export declare class LanguageModelToolsExtensionPointHandler implements IWorkbenchContribution {
|
|
21
22
|
static readonly ID = "workbench.contrib.toolsExtensionPointHandler";
|
|
22
23
|
private _registrationDisposables;
|
|
23
|
-
constructor(languageModelToolsService: ILanguageModelToolsService, logService: ILogService);
|
|
24
|
+
constructor(languageModelToolsService: ILanguageModelToolsService, logService: ILogService, productService: IProductService);
|
|
24
25
|
}
|
|
@@ -6,8 +6,10 @@ import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/res
|
|
|
6
6
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
7
7
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
8
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
+
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
9
10
|
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
10
11
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
|
+
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
11
13
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
12
14
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
13
15
|
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
@@ -24,7 +26,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
24
26
|
},
|
|
25
27
|
jsonSchema: {
|
|
26
28
|
description: ( localize(
|
|
27
|
-
|
|
29
|
+
5007,
|
|
28
30
|
'Contributes a tool that can be invoked by a language model in a chat session, or from a standalone command. Registered tools can be used by all extensions.'
|
|
29
31
|
)),
|
|
30
32
|
type: 'array',
|
|
@@ -50,7 +52,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
50
52
|
properties: {
|
|
51
53
|
name: {
|
|
52
54
|
description: ( localize(
|
|
53
|
-
|
|
55
|
+
5008,
|
|
54
56
|
"A unique name for this tool. This name must be a globally unique identifier, and is also used as a name when presenting this tool to a language model."
|
|
55
57
|
)),
|
|
56
58
|
type: 'string',
|
|
@@ -58,7 +60,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
58
60
|
},
|
|
59
61
|
toolReferenceName: {
|
|
60
62
|
markdownDescription: ( localize(
|
|
61
|
-
|
|
63
|
+
5009,
|
|
62
64
|
"If {0} is enabled for this tool, the user may use '#' with this name to invoke the tool in a query. Otherwise, the name is not required. Name must not contain whitespace.",
|
|
63
65
|
'`canBeReferencedInPrompt`'
|
|
64
66
|
)),
|
|
@@ -67,32 +69,32 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
67
69
|
},
|
|
68
70
|
displayName: {
|
|
69
71
|
description: ( localize(
|
|
70
|
-
|
|
72
|
+
5010,
|
|
71
73
|
"A human-readable name for this tool that may be used to describe it in the UI."
|
|
72
74
|
)),
|
|
73
75
|
type: 'string'
|
|
74
76
|
},
|
|
75
77
|
userDescription: {
|
|
76
|
-
description: ( localize(
|
|
78
|
+
description: ( localize(5011, "A description of this tool that may be shown to the user.")),
|
|
77
79
|
type: 'string'
|
|
78
80
|
},
|
|
79
81
|
modelDescription: {
|
|
80
82
|
description: ( localize(
|
|
81
|
-
|
|
83
|
+
5012,
|
|
82
84
|
"A description of this tool that may be used by a language model to select it."
|
|
83
85
|
)),
|
|
84
86
|
type: 'string'
|
|
85
87
|
},
|
|
86
88
|
inputSchema: {
|
|
87
89
|
description: ( localize(
|
|
88
|
-
|
|
90
|
+
5013,
|
|
89
91
|
"A JSON schema for the input this tool accepts. The input must be an object at the top level. A particular language model may not support all JSON schema features. See the documentation for the language model family you are using for more information."
|
|
90
92
|
)),
|
|
91
93
|
$ref: toolsParametersSchemaSchemaId
|
|
92
94
|
},
|
|
93
95
|
canBeReferencedInPrompt: {
|
|
94
96
|
markdownDescription: ( localize(
|
|
95
|
-
|
|
97
|
+
5014,
|
|
96
98
|
"If true, this tool shows up as an attachment that the user can add manually to their request. Chat participants will receive the tool in {0}.",
|
|
97
99
|
'`ChatRequest#toolReferences`'
|
|
98
100
|
)),
|
|
@@ -100,7 +102,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
100
102
|
},
|
|
101
103
|
icon: {
|
|
102
104
|
markdownDescription: ( localize(
|
|
103
|
-
|
|
105
|
+
5015,
|
|
104
106
|
"An icon that represents this tool. Either a file path, an object with file paths for dark and light themes, or a theme icon reference, like `$(zap)`"
|
|
105
107
|
)),
|
|
106
108
|
anyOf: [{
|
|
@@ -110,11 +112,11 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
110
112
|
type: 'object',
|
|
111
113
|
properties: {
|
|
112
114
|
light: {
|
|
113
|
-
description: ( localize(
|
|
115
|
+
description: ( localize(5016, 'Icon path when a light theme is used')),
|
|
114
116
|
type: 'string'
|
|
115
117
|
},
|
|
116
118
|
dark: {
|
|
117
|
-
description: ( localize(
|
|
119
|
+
description: ( localize(5017, 'Icon path when a dark theme is used')),
|
|
118
120
|
type: 'string'
|
|
119
121
|
}
|
|
120
122
|
}
|
|
@@ -122,14 +124,14 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
122
124
|
},
|
|
123
125
|
when: {
|
|
124
126
|
markdownDescription: ( localize(
|
|
125
|
-
|
|
127
|
+
5018,
|
|
126
128
|
"Condition which must be true for this tool to be enabled. Note that a tool may still be invoked by another extension even when its `when` condition is false."
|
|
127
129
|
)),
|
|
128
130
|
type: 'string'
|
|
129
131
|
},
|
|
130
132
|
tags: {
|
|
131
133
|
description: ( localize(
|
|
132
|
-
|
|
134
|
+
5019,
|
|
133
135
|
"A set of tags that roughly describe the tool's capabilities. A tool user may use these to filter the set of tools to just ones that are relevant for the task at hand, or they may want to pick a tag that can be used to identify just the tools contributed by this extension."
|
|
134
136
|
)),
|
|
135
137
|
type: 'array',
|
|
@@ -145,9 +147,10 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
145
147
|
function toToolKey(extensionIdentifier, toolName) {
|
|
146
148
|
return `${extensionIdentifier.value}/${toolName}`;
|
|
147
149
|
}
|
|
150
|
+
const CopilotAgentModeTag = 'vscode_editing';
|
|
148
151
|
let LanguageModelToolsExtensionPointHandler = class LanguageModelToolsExtensionPointHandler {
|
|
149
152
|
static { this.ID = 'workbench.contrib.toolsExtensionPointHandler'; }
|
|
150
|
-
constructor(languageModelToolsService, logService) {
|
|
153
|
+
constructor(languageModelToolsService, logService, productService) {
|
|
151
154
|
this._registrationDisposables = ( new DisposableMap());
|
|
152
155
|
languageModelToolsExtensionPoint.setHandler((extensions, delta) => {
|
|
153
156
|
for (const extension of delta.added) {
|
|
@@ -168,7 +171,13 @@ let LanguageModelToolsExtensionPointHandler = class LanguageModelToolsExtensionP
|
|
|
168
171
|
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with name starting with "vscode_" or "copilot_"`);
|
|
169
172
|
continue;
|
|
170
173
|
}
|
|
171
|
-
if (rawTool.tags?.
|
|
174
|
+
if (rawTool.tags?.includes(CopilotAgentModeTag)) {
|
|
175
|
+
if (!isProposedApiEnabled(extension.description, 'languageModelToolsForAgent') && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
|
|
176
|
+
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tag "${CopilotAgentModeTag}" without enabling 'languageModelToolsForAgent' proposal`);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (rawTool.tags?.some(tag => tag !== CopilotAgentModeTag && (tag.startsWith('copilot_') || tag.startsWith('vscode_'))) && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
|
|
172
181
|
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tags starting with "vscode_" or "copilot_"`);
|
|
173
182
|
continue;
|
|
174
183
|
}
|
|
@@ -186,13 +195,21 @@ let LanguageModelToolsExtensionPointHandler = class LanguageModelToolsExtensionP
|
|
|
186
195
|
light: joinPath(extension.description.extensionLocation, rawIcon.light)
|
|
187
196
|
};
|
|
188
197
|
}
|
|
198
|
+
const isBuiltinTool = productService.defaultChatAgent?.chatExtensionId ?
|
|
199
|
+
ExtensionIdentifier.equals(extension.description.identifier, productService.defaultChatAgent.chatExtensionId) :
|
|
200
|
+
isProposedApiEnabled(extension.description, 'chatParticipantPrivate');
|
|
189
201
|
const tool = {
|
|
190
202
|
...rawTool,
|
|
191
|
-
extensionId: extension.description.identifier,
|
|
203
|
+
source: { type: 'extension', extensionId: extension.description.identifier, isExternalTool: !isBuiltinTool },
|
|
192
204
|
inputSchema: rawTool.inputSchema,
|
|
193
205
|
id: rawTool.name,
|
|
194
206
|
icon,
|
|
195
207
|
when: rawTool.when ? ContextKeyExpr.deserialize(rawTool.when) : undefined,
|
|
208
|
+
requiresConfirmation: !isBuiltinTool,
|
|
209
|
+
alwaysDisplayInputOutput: !isBuiltinTool,
|
|
210
|
+
supportsToolPicker: isBuiltinTool ?
|
|
211
|
+
false :
|
|
212
|
+
rawTool.canBeReferencedInPrompt
|
|
196
213
|
};
|
|
197
214
|
const disposable = languageModelToolsService.registerToolData(tool);
|
|
198
215
|
this._registrationDisposables.set(toToolKey(extension.description.identifier, rawTool.name), disposable);
|
|
@@ -208,7 +225,8 @@ let LanguageModelToolsExtensionPointHandler = class LanguageModelToolsExtensionP
|
|
|
208
225
|
};
|
|
209
226
|
LanguageModelToolsExtensionPointHandler = ( __decorate([
|
|
210
227
|
( __param(0, ILanguageModelToolsService)),
|
|
211
|
-
( __param(1, ILogService))
|
|
228
|
+
( __param(1, ILogService)),
|
|
229
|
+
( __param(2, IProductService))
|
|
212
230
|
], LanguageModelToolsExtensionPointHandler));
|
|
213
231
|
class LanguageModelToolDataRenderer extends Disposable {
|
|
214
232
|
constructor() {
|
|
@@ -224,9 +242,9 @@ class LanguageModelToolDataRenderer extends Disposable {
|
|
|
224
242
|
return { data: { headers: [], rows: [] }, dispose: () => { } };
|
|
225
243
|
}
|
|
226
244
|
const headers = [
|
|
227
|
-
( localize(
|
|
228
|
-
( localize(
|
|
229
|
-
( localize(
|
|
245
|
+
( localize(5020, "Name")),
|
|
246
|
+
( localize(5021, "Display Name")),
|
|
247
|
+
( localize(5022, "Description")),
|
|
230
248
|
];
|
|
231
249
|
const rows = ( contribs.map(t => {
|
|
232
250
|
return [
|
|
@@ -246,7 +264,7 @@ class LanguageModelToolDataRenderer extends Disposable {
|
|
|
246
264
|
}
|
|
247
265
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
248
266
|
id: 'languageModelTools',
|
|
249
|
-
label: ( localize(
|
|
267
|
+
label: ( localize(5023, "Language Model Tools")),
|
|
250
268
|
access: {
|
|
251
269
|
canToggle: false
|
|
252
270
|
},
|
|
@@ -22,7 +22,6 @@ export declare const VoiceChatInProgress: RawContextKey<boolean>;
|
|
|
22
22
|
export declare class VoiceChatService extends Disposable implements IVoiceChatService {
|
|
23
23
|
private readonly speechService;
|
|
24
24
|
private readonly chatAgentService;
|
|
25
|
-
private readonly contextKeyService;
|
|
26
25
|
readonly _serviceBrand: undefined;
|
|
27
26
|
private static readonly AGENT_PREFIX;
|
|
28
27
|
private static readonly COMMAND_PREFIX;
|
|
@@ -21,7 +21,7 @@ var PhraseTextType;
|
|
|
21
21
|
const VoiceChatInProgress = ( new RawContextKey(
|
|
22
22
|
'voiceChatInProgress',
|
|
23
23
|
false,
|
|
24
|
-
{ type: 'boolean', description: ( localize(
|
|
24
|
+
{ type: 'boolean', description: ( localize(5024, "A speech-to-text session is in progress for chat.")) }
|
|
25
25
|
));
|
|
26
26
|
let VoiceChatService = class VoiceChatService extends Disposable {
|
|
27
27
|
static { VoiceChatService_1 = this; }
|
|
@@ -40,9 +40,8 @@ let VoiceChatService = class VoiceChatService extends Disposable {
|
|
|
40
40
|
super();
|
|
41
41
|
this.speechService = speechService;
|
|
42
42
|
this.chatAgentService = chatAgentService;
|
|
43
|
-
this.contextKeyService = contextKeyService;
|
|
44
|
-
this.voiceChatInProgress = VoiceChatInProgress.bindTo(this.contextKeyService);
|
|
45
43
|
this.activeVoiceChatSessions = 0;
|
|
44
|
+
this.voiceChatInProgress = VoiceChatInProgress.bindTo(contextKeyService);
|
|
46
45
|
}
|
|
47
46
|
createPhrases(model) {
|
|
48
47
|
const phrases = ( new Map());
|
|
@@ -34,7 +34,7 @@ const editActionMenuItem = {
|
|
|
34
34
|
order: 0,
|
|
35
35
|
command: {
|
|
36
36
|
id: ChatSubmitAction.ID,
|
|
37
|
-
title: ( localize(
|
|
37
|
+
title: ( localize(7151, "Edit Code")),
|
|
38
38
|
},
|
|
39
39
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), CTX_INLINE_CHAT_EDITING)),
|
|
40
40
|
};
|
|
@@ -43,7 +43,7 @@ const generateActionMenuItem = {
|
|
|
43
43
|
order: 0,
|
|
44
44
|
command: {
|
|
45
45
|
id: ChatSubmitAction.ID,
|
|
46
|
-
title: ( localize(
|
|
46
|
+
title: ( localize(7152, "Generate")),
|
|
47
47
|
},
|
|
48
48
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), ( CTX_INLINE_CHAT_EDITING.toNegated()))),
|
|
49
49
|
};
|
|
@@ -54,8 +54,8 @@ const cancelActionMenuItem = {
|
|
|
54
54
|
order: 0,
|
|
55
55
|
command: {
|
|
56
56
|
id: CancelAction.ID,
|
|
57
|
-
title: ( localize(
|
|
58
|
-
shortTitle: ( localize(
|
|
57
|
+
title: ( localize(7153, "Cancel Request")),
|
|
58
|
+
shortTitle: ( localize(7154, "Cancel")),
|
|
59
59
|
},
|
|
60
60
|
when: ( ContextKeyExpr.and(CTX_INLINE_CHAT_REQUEST_IN_PROGRESS)),
|
|
61
61
|
};
|