@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/browser/chatEditing/chatEditingServiceImpl.d.ts
CHANGED
|
@@ -13,10 +13,12 @@ import { IDecorationsService } from "@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
13
13
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
14
14
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
15
15
|
import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
|
|
16
|
-
import { IMultiDiffSourceResolver, IResolvedMultiDiffSource } from "@codingame/monaco-vscode-
|
|
16
|
+
import { IMultiDiffSourceResolver, IResolvedMultiDiffSource } from "@codingame/monaco-vscode-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
|
|
17
17
|
import { IMultiDiffSourceResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service";
|
|
18
|
+
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
18
19
|
import { IChatEditingSession, IChatRelatedFile, IChatRelatedFilesProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
19
20
|
import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
|
|
21
|
+
import { ChatModel } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
20
22
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
21
23
|
export declare class ChatEditingService extends Disposable implements IChatEditingService {
|
|
22
24
|
private readonly _instantiationService;
|
|
@@ -24,17 +26,18 @@ export declare class ChatEditingService extends Disposable implements IChatEditi
|
|
|
24
26
|
private readonly _editorService;
|
|
25
27
|
private readonly _fileService;
|
|
26
28
|
private readonly lifecycleService;
|
|
29
|
+
private readonly notebookService;
|
|
27
30
|
_serviceBrand: undefined;
|
|
28
31
|
private readonly _sessionsObs;
|
|
29
32
|
readonly editingSessionsObs: IObservable<readonly IChatEditingSession[]>;
|
|
30
33
|
private _restoringEditingSession;
|
|
31
34
|
private _chatRelatedFilesProviders;
|
|
32
|
-
constructor(_instantiationService: IInstantiationService, multiDiffSourceResolverService: IMultiDiffSourceResolverService, textModelService: ITextModelService, contextKeyService: IContextKeyService, _chatService: IChatService, _editorService: IEditorService, decorationsService: IDecorationsService, _fileService: IFileService, lifecycleService: ILifecycleService, storageService: IStorageService, logService: ILogService, extensionService: IExtensionService, productService: IProductService);
|
|
35
|
+
constructor(_instantiationService: IInstantiationService, multiDiffSourceResolverService: IMultiDiffSourceResolverService, textModelService: ITextModelService, contextKeyService: IContextKeyService, _chatService: IChatService, _editorService: IEditorService, decorationsService: IDecorationsService, _fileService: IFileService, lifecycleService: ILifecycleService, storageService: IStorageService, logService: ILogService, extensionService: IExtensionService, productService: IProductService, notebookService: INotebookService);
|
|
33
36
|
dispose(): void;
|
|
34
|
-
startOrContinueGlobalEditingSession(
|
|
37
|
+
startOrContinueGlobalEditingSession(chatModel: ChatModel, waitForRestore?: boolean): Promise<IChatEditingSession>;
|
|
35
38
|
private _lookupEntry;
|
|
36
39
|
getEditingSession(chatSessionId: string): IChatEditingSession | undefined;
|
|
37
|
-
createEditingSession(
|
|
40
|
+
createEditingSession(chatModel: ChatModel, global?: boolean): Promise<IChatEditingSession>;
|
|
38
41
|
private installAutoApplyObserver;
|
|
39
42
|
private observerEditsInResponse;
|
|
40
43
|
hasRelatedFilesProviders(): boolean;
|
|
@@ -9,9 +9,10 @@ import { Disposable, dispose, DisposableStore, toDisposable } from '@codingame/m
|
|
|
9
9
|
import { LinkedList } from '@codingame/monaco-vscode-api/vscode/vs/base/common/linkedList';
|
|
10
10
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
11
11
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
12
|
+
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
13
|
import { compare } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
13
14
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
14
|
-
import {
|
|
15
|
+
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
15
16
|
import { TextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
16
17
|
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
17
18
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
@@ -20,36 +21,37 @@ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/fi
|
|
|
20
21
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
22
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
22
23
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
23
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
24
24
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
25
25
|
import { IDecorationsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/decorations/common/decorations.service';
|
|
26
26
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
27
27
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
28
28
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
29
|
-
import { MultiDiffEditorItem } from '@codingame/monaco-vscode-
|
|
29
|
+
import { MultiDiffEditorItem } from '@codingame/monaco-vscode-ae8a8ca1-f243-508b-9c37-c88ebbd295fa-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService';
|
|
30
30
|
import { IMultiDiffSourceResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service';
|
|
31
31
|
import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
32
|
-
import {
|
|
32
|
+
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
33
33
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
34
34
|
import { chatEditingSnapshotScheme, chatEditingAgentSupportsReadonlyReferencesContextKey, ChatEditingSessionState, WorkingSetEntryState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, chatEditingResourceContextKey, inChatEditingSessionContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
35
35
|
import { isCellTextEditOperation } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
36
36
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
37
|
+
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
38
|
+
import { ChatEditorInput } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
39
|
+
import { AbstractChatEditingModifiedFileEntry } from './chatEditingModifiedFileEntry.js';
|
|
40
|
+
import { ChatEditingSession } from './chatEditingSession.js';
|
|
41
|
+
import { ChatEditingTextModelContentProvider, ChatEditingSnapshotTextModelContentProvider } from './chatEditingTextModelContentProviders.js';
|
|
40
42
|
import { observableValueOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/api';
|
|
41
43
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
42
44
|
import { runOnChange, ValueWithChangeEventFromObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
43
45
|
|
|
44
|
-
const STORAGE_KEY_EDITING_SESSION = 'chat.editingSession';
|
|
45
46
|
let ChatEditingService = class ChatEditingService extends Disposable {
|
|
46
|
-
constructor(_instantiationService, multiDiffSourceResolverService, textModelService, contextKeyService, _chatService, _editorService, decorationsService, _fileService, lifecycleService, storageService, logService, extensionService, productService) {
|
|
47
|
+
constructor(_instantiationService, multiDiffSourceResolverService, textModelService, contextKeyService, _chatService, _editorService, decorationsService, _fileService, lifecycleService, storageService, logService, extensionService, productService, notebookService) {
|
|
47
48
|
super();
|
|
48
49
|
this._instantiationService = _instantiationService;
|
|
49
50
|
this._chatService = _chatService;
|
|
50
51
|
this._editorService = _editorService;
|
|
51
52
|
this._fileService = _fileService;
|
|
52
53
|
this.lifecycleService = lifecycleService;
|
|
54
|
+
this.notebookService = notebookService;
|
|
53
55
|
this._sessionsObs = observableValueOpts({ equalsFn: (a, b) => false }, ( new LinkedList()));
|
|
54
56
|
this.editingSessionsObs = derived(r => {
|
|
55
57
|
const result = Array.from(this._sessionsObs.read(r));
|
|
@@ -75,18 +77,13 @@ let ChatEditingService = class ChatEditingService extends Disposable {
|
|
|
75
77
|
this._register(extensionService.onDidChangeExtensions(setReadonlyFilesEnabled));
|
|
76
78
|
let storageTask;
|
|
77
79
|
this._register(storageService.onWillSaveState(() => {
|
|
78
|
-
const sessionIds = [];
|
|
79
80
|
const tasks = [];
|
|
80
81
|
for (const session of this.editingSessionsObs.get()) {
|
|
81
82
|
if (!session.isGlobalEditingSession) {
|
|
82
83
|
continue;
|
|
83
84
|
}
|
|
84
|
-
sessionIds.push(session.chatSessionId);
|
|
85
85
|
tasks.push(session.storeState());
|
|
86
86
|
}
|
|
87
|
-
if (sessionIds.length) {
|
|
88
|
-
storageService.store(STORAGE_KEY_EDITING_SESSION, sessionIds.join(), StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
89
|
-
}
|
|
90
87
|
storageTask = Promise.resolve(storageTask)
|
|
91
88
|
.then(() => Promise.all(tasks))
|
|
92
89
|
.finally(() => storageTask = undefined);
|
|
@@ -97,38 +94,24 @@ let ChatEditingService = class ChatEditingService extends Disposable {
|
|
|
97
94
|
}
|
|
98
95
|
e.join(storageTask, {
|
|
99
96
|
id: 'join.chatEditingSession',
|
|
100
|
-
label: ( localize(
|
|
97
|
+
label: ( localize(4690, "Saving chat edits history"))
|
|
101
98
|
});
|
|
102
99
|
}));
|
|
103
|
-
const rawSessionsToRestore = storageService.get(STORAGE_KEY_EDITING_SESSION, StorageScope.WORKSPACE);
|
|
104
|
-
if (isString(rawSessionsToRestore)) {
|
|
105
|
-
const sessionIds = rawSessionsToRestore.split(',');
|
|
106
|
-
const tasks = [];
|
|
107
|
-
for (const sessionId of sessionIds) {
|
|
108
|
-
const chatModel = _chatService.getOrRestoreSession(sessionId);
|
|
109
|
-
if (!chatModel) {
|
|
110
|
-
logService.error(`Edit session session to restore is a non-existing chat session: ${rawSessionsToRestore}`);
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
tasks.push(this.startOrContinueGlobalEditingSession(chatModel.sessionId));
|
|
114
|
-
}
|
|
115
|
-
this._restoringEditingSession = Promise.all(tasks).finally(() => {
|
|
116
|
-
this._restoringEditingSession = undefined;
|
|
117
|
-
});
|
|
118
|
-
storageService.remove(STORAGE_KEY_EDITING_SESSION, StorageScope.WORKSPACE);
|
|
119
|
-
}
|
|
120
100
|
}
|
|
121
101
|
dispose() {
|
|
122
102
|
dispose(this._sessionsObs.get());
|
|
123
103
|
super.dispose();
|
|
124
104
|
}
|
|
125
|
-
async startOrContinueGlobalEditingSession(
|
|
126
|
-
|
|
127
|
-
|
|
105
|
+
async startOrContinueGlobalEditingSession(chatModel, waitForRestore = true) {
|
|
106
|
+
if (waitForRestore) {
|
|
107
|
+
await this._restoringEditingSession;
|
|
108
|
+
}
|
|
109
|
+
const session = this.getEditingSession(chatModel.sessionId);
|
|
128
110
|
if (session) {
|
|
129
111
|
return session;
|
|
130
112
|
}
|
|
131
|
-
|
|
113
|
+
const result = await this.createEditingSession(chatModel, true);
|
|
114
|
+
return result;
|
|
132
115
|
}
|
|
133
116
|
_lookupEntry(uri) {
|
|
134
117
|
for (const item of Iterable.concat(this.editingSessionsObs.get())) {
|
|
@@ -143,15 +126,15 @@ let ChatEditingService = class ChatEditingService extends Disposable {
|
|
|
143
126
|
return this.editingSessionsObs.get()
|
|
144
127
|
.find(candidate => candidate.chatSessionId === chatSessionId);
|
|
145
128
|
}
|
|
146
|
-
async createEditingSession(
|
|
147
|
-
assertType(this.getEditingSession(
|
|
148
|
-
const session = this._instantiationService.createInstance(ChatEditingSession,
|
|
129
|
+
async createEditingSession(chatModel, global = false) {
|
|
130
|
+
assertType(this.getEditingSession(chatModel.sessionId) === undefined, 'CANNOT have more than one editing session per chat session');
|
|
131
|
+
const session = this._instantiationService.createInstance(ChatEditingSession, chatModel.sessionId, global, this._lookupEntry.bind(this));
|
|
149
132
|
await session.init();
|
|
150
133
|
const list = this._sessionsObs.get();
|
|
151
134
|
const removeSession = list.unshift(session);
|
|
152
135
|
const store = ( new DisposableStore());
|
|
153
136
|
this._store.add(store);
|
|
154
|
-
store.add(this.installAutoApplyObserver(session));
|
|
137
|
+
store.add(this.installAutoApplyObserver(session, chatModel));
|
|
155
138
|
store.add(session.onDidDispose(e => {
|
|
156
139
|
removeSession();
|
|
157
140
|
this._sessionsObs.set(list, undefined);
|
|
@@ -160,8 +143,7 @@ let ChatEditingService = class ChatEditingService extends Disposable {
|
|
|
160
143
|
this._sessionsObs.set(list, undefined);
|
|
161
144
|
return session;
|
|
162
145
|
}
|
|
163
|
-
installAutoApplyObserver(session) {
|
|
164
|
-
const chatModel = this._chatService.getOrRestoreSession(session.chatSessionId);
|
|
146
|
+
installAutoApplyObserver(session, chatModel) {
|
|
165
147
|
if (!chatModel) {
|
|
166
148
|
throw ( new ErrorNoTelemetry(
|
|
167
149
|
`Edit session was created for a non-existing chat session: ${session.chatSessionId}`
|
|
@@ -189,12 +171,14 @@ let ChatEditingService = class ChatEditingService extends Disposable {
|
|
|
189
171
|
if (( editedFilesExist.has(uri))) {
|
|
190
172
|
return;
|
|
191
173
|
}
|
|
192
|
-
|
|
174
|
+
const fileExists = this.notebookService.getNotebookTextModel(uri) ? Promise.resolve(true) : this._fileService.exists(uri);
|
|
175
|
+
editedFilesExist.set(uri, fileExists.then((e) => {
|
|
193
176
|
if (!e) {
|
|
194
177
|
return;
|
|
195
178
|
}
|
|
196
179
|
const activeUri = this._editorService.activeEditorPane?.input.resource;
|
|
197
|
-
const inactive =
|
|
180
|
+
const inactive = this._editorService.activeEditorPane?.input instanceof ChatEditorInput && this._editorService.activeEditorPane.input.sessionId === session.chatSessionId ||
|
|
181
|
+
Boolean(activeUri && session.entries.get().find(entry => isEqual(activeUri, entry.modifiedURI)));
|
|
198
182
|
this._editorService.openEditor({ resource: uri, options: { inactive, preserveFocus: true, pinned: true } });
|
|
199
183
|
}));
|
|
200
184
|
};
|
|
@@ -314,7 +298,8 @@ ChatEditingService = ( __decorate([
|
|
|
314
298
|
( __param(9, IStorageService)),
|
|
315
299
|
( __param(10, ILogService)),
|
|
316
300
|
( __param(11, IExtensionService)),
|
|
317
|
-
( __param(12, IProductService))
|
|
301
|
+
( __param(12, IProductService)),
|
|
302
|
+
( __param(13, INotebookService))
|
|
318
303
|
], ChatEditingService));
|
|
319
304
|
function observeArrayChanges(obs, compare, store) {
|
|
320
305
|
const emitter = store.add(( new Emitter()));
|
|
@@ -330,7 +315,7 @@ let ChatDecorationsProvider = class ChatDecorationsProvider extends Disposable {
|
|
|
330
315
|
super();
|
|
331
316
|
this._sessions = _sessions;
|
|
332
317
|
this._chatAgentService = _chatAgentService;
|
|
333
|
-
this.label = ( localize(
|
|
318
|
+
this.label = ( localize(4691, "Chat Editing"));
|
|
334
319
|
this._currentEntries = derived(this, (r) => {
|
|
335
320
|
const sessions = this._sessions.read(r);
|
|
336
321
|
if (!sessions) {
|
|
@@ -370,7 +355,7 @@ let ChatDecorationsProvider = class ChatDecorationsProvider extends Disposable {
|
|
|
370
355
|
return {
|
|
371
356
|
weight: 1000,
|
|
372
357
|
letter: Codicon.diffModified,
|
|
373
|
-
tooltip: defaultAgentName ? ( localize(
|
|
358
|
+
tooltip: defaultAgentName ? ( localize(4692, "Pending changes from {0}", defaultAgentName)) : ( localize(4693, "Pending changes from chat")),
|
|
374
359
|
bubble: true
|
|
375
360
|
};
|
|
376
361
|
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { ResourceMap } from "@codingame/monaco-vscode-api/vscode/vs/base/common/map";
|
|
3
|
+
import { IObservable, IReader } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
4
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
5
|
+
import { IBulkEditService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service";
|
|
6
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
7
|
+
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
8
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
9
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
10
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
11
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
12
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
13
|
+
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
14
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
15
|
+
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
16
|
+
import { ChatEditingSessionChangeType, ChatEditingSessionState, IChatEditingSession, IEditSessionEntryDiff, IModifiedFileEntry, IStreamingEdits, WorkingSetDisplayMetadata, WorkingSetEntryRemovalReason } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
17
|
+
import { IChatResponseModel } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
18
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
19
|
+
import { AbstractChatEditingModifiedFileEntry, ISnapshotEntry } from "./chatEditingModifiedFileEntry.js";
|
|
20
|
+
import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
|
|
21
|
+
export declare class ChatEditingSession extends Disposable implements IChatEditingSession {
|
|
22
|
+
readonly chatSessionId: string;
|
|
23
|
+
readonly isGlobalEditingSession: boolean;
|
|
24
|
+
private _lookupExternalEntry;
|
|
25
|
+
private readonly _instantiationService;
|
|
26
|
+
private readonly _modelService;
|
|
27
|
+
private readonly _languageService;
|
|
28
|
+
private readonly _textModelService;
|
|
29
|
+
readonly _bulkEditService: IBulkEditService;
|
|
30
|
+
private readonly _editorGroupsService;
|
|
31
|
+
private readonly _editorService;
|
|
32
|
+
private readonly _chatService;
|
|
33
|
+
private readonly _notebookService;
|
|
34
|
+
private readonly _editorWorkerService;
|
|
35
|
+
private readonly _configurationService;
|
|
36
|
+
private readonly _accessibilitySignalService;
|
|
37
|
+
private readonly _state;
|
|
38
|
+
private readonly _linearHistory;
|
|
39
|
+
private readonly _linearHistoryIndex;
|
|
40
|
+
private readonly _initialFileContents;
|
|
41
|
+
private readonly _entriesObs;
|
|
42
|
+
get entries(): IObservable<readonly IModifiedFileEntry[]>;
|
|
43
|
+
private _workingSet;
|
|
44
|
+
private _editorPane;
|
|
45
|
+
get state(): IObservable<ChatEditingSessionState>;
|
|
46
|
+
readonly canUndo: IObservable<boolean>;
|
|
47
|
+
readonly canRedo: IObservable<boolean>;
|
|
48
|
+
private readonly _onDidChange;
|
|
49
|
+
get onDidChange(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<ChatEditingSessionChangeType>;
|
|
50
|
+
private readonly _onDidDispose;
|
|
51
|
+
get onDidDispose(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
52
|
+
constructor(chatSessionId: string, isGlobalEditingSession: boolean, _lookupExternalEntry: (uri: URI) => AbstractChatEditingModifiedFileEntry | undefined, _instantiationService: IInstantiationService, _modelService: IModelService, _languageService: ILanguageService, _textModelService: ITextModelService, _bulkEditService: IBulkEditService, _editorGroupsService: IEditorGroupsService, _editorService: IEditorService, _chatService: IChatService, _notebookService: INotebookService, _editorWorkerService: IEditorWorkerService, _configurationService: IConfigurationService, _accessibilitySignalService: IAccessibilitySignalService);
|
|
53
|
+
init(): Promise<void>;
|
|
54
|
+
private _getEntry;
|
|
55
|
+
getEntry(uri: URI): IModifiedFileEntry | undefined;
|
|
56
|
+
readEntry(uri: URI, reader: IReader | undefined): IModifiedFileEntry | undefined;
|
|
57
|
+
storeState(): Promise<void>;
|
|
58
|
+
private _findSnapshot;
|
|
59
|
+
private _findEditStop;
|
|
60
|
+
private _ensurePendingSnapshot;
|
|
61
|
+
private _diffsBetweenStops;
|
|
62
|
+
private readonly _ignoreTrimWhitespaceObservable;
|
|
63
|
+
private _entryDiffBetweenTextStops;
|
|
64
|
+
private _createDiffBetweenStopsObservable;
|
|
65
|
+
getEntryDiffBetweenStops(uri: URI, requestId: string, stopId: string | undefined): IObservable<IEditSessionEntryDiff | undefined>;
|
|
66
|
+
createSnapshot(requestId: string, undoStop: string | undefined): void;
|
|
67
|
+
private _createSnapshot;
|
|
68
|
+
getSnapshot(requestId: string, undoStop: string | undefined, snapshotUri: URI): ISnapshotEntry | undefined;
|
|
69
|
+
getSnapshotModel(requestId: string, undoStop: string | undefined, snapshotUri: URI): Promise<ITextModel | null>;
|
|
70
|
+
getSnapshotUri(requestId: string, uri: URI, stopId: string | undefined): URI | undefined;
|
|
71
|
+
private _pendingSnapshot;
|
|
72
|
+
restoreSnapshot(requestId: string | undefined, stopId: string | undefined): Promise<void>;
|
|
73
|
+
private _restoreSnapshot;
|
|
74
|
+
remove(reason: WorkingSetEntryRemovalReason, ...uris: URI[]): void;
|
|
75
|
+
private _assertNotDisposed;
|
|
76
|
+
accept(...uris: URI[]): Promise<void>;
|
|
77
|
+
reject(...uris: URI[]): Promise<void>;
|
|
78
|
+
show(): Promise<void>;
|
|
79
|
+
private _stopPromise;
|
|
80
|
+
stop(clearState?: boolean): Promise<void>;
|
|
81
|
+
private _performStop;
|
|
82
|
+
dispose(): void;
|
|
83
|
+
private _streamingEditLocks;
|
|
84
|
+
private get isDisposed();
|
|
85
|
+
startStreamingEdits(resource: URI, responseModel: IChatResponseModel, inUndoStop: string | undefined): IStreamingEdits;
|
|
86
|
+
private _getHistoryEntryByLinearIndex;
|
|
87
|
+
undoInteraction(): Promise<void>;
|
|
88
|
+
redoInteraction(): Promise<void>;
|
|
89
|
+
private _updateRequestHiddenState;
|
|
90
|
+
private _acceptStreamingEditsStart;
|
|
91
|
+
private ensureEditInUndoStopMatches;
|
|
92
|
+
private _acceptEdits;
|
|
93
|
+
private _getTelemetryInfoForModel;
|
|
94
|
+
private _resolve;
|
|
95
|
+
private _getOrCreateModifiedFileEntry;
|
|
96
|
+
private _createModifiedFileEntry;
|
|
97
|
+
private _collapse;
|
|
98
|
+
}
|
|
99
|
+
export interface IChatEditingSessionSnapshot {
|
|
100
|
+
readonly startIndex: number;
|
|
101
|
+
readonly requestId: string | undefined;
|
|
102
|
+
readonly stops: IChatEditingSessionStop[];
|
|
103
|
+
readonly postEdit: ResourceMap<ISnapshotEntry> | undefined;
|
|
104
|
+
}
|
|
105
|
+
interface IChatEditingSessionStop {
|
|
106
|
+
stopId: string | undefined;
|
|
107
|
+
readonly workingSet: ResourceMap<WorkingSetDisplayMetadata>;
|
|
108
|
+
readonly entries: ResourceMap<ISnapshotEntry>;
|
|
109
|
+
}
|
|
110
|
+
export {};
|