@codingame/monaco-vscode-chat-service-override 14.0.6 → 15.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 +14 -8
- package/package.json +20 -20
- package/vscode/src/vs/base/common/objectCache.d.ts +1 -1
- package/vscode/src/vs/base/common/objectCache.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +43 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt.js +142 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +252 -260
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +12 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +31 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +151 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +379 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/{chatEditingService.d.ts → chatEditingServiceImpl.d.ts} +12 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +423 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +38 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +16 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +93 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +21 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +101 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +146 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +386 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +4 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +8 -91
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +7 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +45 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +11 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatEntitlementsService.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +12 -10
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +26 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatQuotasService.js +85 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +33 -27
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.js +15 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptPathAutocompletion.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptPathAutocompletion.js +175 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +31 -36
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +0 -505
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +0 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +0 -871
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +0 -245
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController2.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController2.js +0 -314
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { coalesce, delta, compareBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
4
|
-
import { AsyncIterableSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
|
-
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
6
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
7
|
-
import { BugIndicatingError, ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
8
|
-
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
9
|
-
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
10
|
-
import { Disposable, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
|
-
import { LinkedList } from '@codingame/monaco-vscode-api/vscode/vs/base/common/linkedList';
|
|
12
|
-
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
13
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
14
|
-
import { observableValueOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/api';
|
|
15
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
16
|
-
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
17
|
-
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
18
|
-
import { runOnChange, ValueWithChangeEventFromObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
19
|
-
import { compare } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
20
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
21
|
-
import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
22
|
-
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService';
|
|
23
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
24
|
-
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
25
|
-
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
26
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
27
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
28
|
-
import { bindContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
29
|
-
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
30
|
-
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
31
|
-
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
32
|
-
import { IWorkbenchAssignmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service';
|
|
33
|
-
import { IDecorationsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/decorations/common/decorations.service';
|
|
34
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
35
|
-
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
36
|
-
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
37
|
-
import { MultiDiffEditorItem } from '@codingame/monaco-vscode-168b98e5-dc20-5807-b1f9-798f1f92b37f-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService';
|
|
38
|
-
import { IMultiDiffSourceResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service';
|
|
39
|
-
import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
40
|
-
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
41
|
-
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
42
|
-
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
43
|
-
import { defaultChatEditingMaxFileLimit, applyingChatEditsFailedContextKey, decidedChatEditingResourceContextKey, WorkingSetEntryState, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey, inChatEditingSessionContextKey, applyingChatEditsContextKey, chatEditingAgentSupportsReadonlyReferencesContextKey, chatEditingMaxFileAssignmentName, ChatEditingSessionState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, chatEditingResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
44
|
-
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
45
|
-
import { ChatEditingModifiedFileEntry } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry';
|
|
46
|
-
import { ChatEditingSession } from './chatEditingSession.js';
|
|
47
|
-
import { ChatEditingTextModelContentProvider, ChatEditingSnapshotTextModelContentProvider } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders';
|
|
48
|
-
|
|
49
|
-
const STORAGE_KEY_EDITING_SESSION = 'chat.editingSession';
|
|
50
|
-
let ChatEditingService = class ChatEditingService extends Disposable {
|
|
51
|
-
get currentAutoApplyOperation() {
|
|
52
|
-
return this._currentAutoApplyOperationObs.get();
|
|
53
|
-
}
|
|
54
|
-
get currentEditingSession() {
|
|
55
|
-
return this._currentSessionObs.get();
|
|
56
|
-
}
|
|
57
|
-
get currentEditingSessionObs() {
|
|
58
|
-
return this._currentSessionObs;
|
|
59
|
-
}
|
|
60
|
-
get editingSessionFileLimit() {
|
|
61
|
-
if (this._chatAgentService.toolsAgentModeEnabled) {
|
|
62
|
-
return Number.MAX_SAFE_INTEGER;
|
|
63
|
-
}
|
|
64
|
-
return this._editingSessionFileLimit ?? defaultChatEditingMaxFileLimit;
|
|
65
|
-
}
|
|
66
|
-
constructor(_instantiationService, multiDiffSourceResolverService, textModelService, contextKeyService, _chatService, _editorService, decorationsService, _fileService, lifecycleService, _workbenchAssignmentService, _chatAgentService, storageService, logService, extensionService, productService) {
|
|
67
|
-
super();
|
|
68
|
-
this._instantiationService = _instantiationService;
|
|
69
|
-
this._chatService = _chatService;
|
|
70
|
-
this._editorService = _editorService;
|
|
71
|
-
this._fileService = _fileService;
|
|
72
|
-
this.lifecycleService = lifecycleService;
|
|
73
|
-
this._workbenchAssignmentService = _workbenchAssignmentService;
|
|
74
|
-
this._chatAgentService = _chatAgentService;
|
|
75
|
-
this._currentSessionObs = observableValue(this, null);
|
|
76
|
-
this._currentSessionDisposables = this._register(( new DisposableStore()));
|
|
77
|
-
this._adhocSessionsObs = observableValueOpts({ equalsFn: (a, b) => false }, ( new LinkedList()));
|
|
78
|
-
this.editingSessionsObs = derived(r => {
|
|
79
|
-
const result = Array.from(this._adhocSessionsObs.read(r));
|
|
80
|
-
const globalSession = this._currentSessionObs.read(r);
|
|
81
|
-
if (globalSession) {
|
|
82
|
-
result.push(globalSession);
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
});
|
|
86
|
-
this._currentAutoApplyOperationObs = observableValue(this, null);
|
|
87
|
-
this._chatRelatedFilesProviders = ( new Map());
|
|
88
|
-
this._applyingChatEditsFailedContextKey = applyingChatEditsFailedContextKey.bindTo(contextKeyService);
|
|
89
|
-
this._applyingChatEditsFailedContextKey.set(false);
|
|
90
|
-
this._register(decorationsService.registerDecorationsProvider(_instantiationService.createInstance(ChatDecorationsProvider, this._currentSessionObs)));
|
|
91
|
-
this._register(multiDiffSourceResolverService.registerResolver(_instantiationService.createInstance(ChatEditingMultiDiffSourceResolver, this._currentSessionObs)));
|
|
92
|
-
this._register(textModelService.registerTextModelContentProvider(ChatEditingTextModelContentProvider.scheme, _instantiationService.createInstance(ChatEditingTextModelContentProvider, this._currentSessionObs)));
|
|
93
|
-
this._register(textModelService.registerTextModelContentProvider(ChatEditingSnapshotTextModelContentProvider.scheme, _instantiationService.createInstance(ChatEditingSnapshotTextModelContentProvider, this._currentSessionObs)));
|
|
94
|
-
this._register(bindContextKey(decidedChatEditingResourceContextKey, contextKeyService, (reader) => {
|
|
95
|
-
const currentSession = this._currentSessionObs.read(reader);
|
|
96
|
-
if (!currentSession) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const entries = currentSession.entries.read(reader);
|
|
100
|
-
const decidedEntries = entries.filter(entry => entry.state.read(reader) !== WorkingSetEntryState.Modified);
|
|
101
|
-
return ( decidedEntries.map(entry => entry.entryId));
|
|
102
|
-
}));
|
|
103
|
-
this._register(bindContextKey(hasUndecidedChatEditingResourceContextKey, contextKeyService, (reader) => {
|
|
104
|
-
for (const session of this.editingSessionsObs.read(reader)) {
|
|
105
|
-
const entries = session.entries.read(reader);
|
|
106
|
-
const decidedEntries = entries.filter(entry => entry.state.read(reader) === WorkingSetEntryState.Modified);
|
|
107
|
-
return decidedEntries.length > 0;
|
|
108
|
-
}
|
|
109
|
-
return false;
|
|
110
|
-
}));
|
|
111
|
-
this._register(bindContextKey(hasAppliedChatEditsContextKey, contextKeyService, (reader) => {
|
|
112
|
-
const currentSession = this._currentSessionObs.read(reader);
|
|
113
|
-
if (!currentSession) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
const entries = currentSession.entries.read(reader);
|
|
117
|
-
return entries.length > 0;
|
|
118
|
-
}));
|
|
119
|
-
this._register(bindContextKey(inChatEditingSessionContextKey, contextKeyService, (reader) => {
|
|
120
|
-
return this._currentSessionObs.read(reader) !== null;
|
|
121
|
-
}));
|
|
122
|
-
this._register(bindContextKey(applyingChatEditsContextKey, contextKeyService, (reader) => {
|
|
123
|
-
return this._currentAutoApplyOperationObs.read(reader) !== null;
|
|
124
|
-
}));
|
|
125
|
-
this._register(bindContextKey(ChatContextKeys.chatEditingCanUndo, contextKeyService, (r) => {
|
|
126
|
-
return this._currentSessionObs.read(r)?.canUndo.read(r) || false;
|
|
127
|
-
}));
|
|
128
|
-
this._register(bindContextKey(ChatContextKeys.chatEditingCanRedo, contextKeyService, (r) => {
|
|
129
|
-
return this._currentSessionObs.read(r)?.canRedo.read(r) || false;
|
|
130
|
-
}));
|
|
131
|
-
this._register(this._chatService.onDidDisposeSession((e) => {
|
|
132
|
-
if (e.reason === 'cleared' && this._currentSessionObs.get()?.chatSessionId === e.sessionId) {
|
|
133
|
-
this._applyingChatEditsFailedContextKey.set(false);
|
|
134
|
-
void this._currentSessionObs.get()?.stop();
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
const readonlyEnabledContextKey = chatEditingAgentSupportsReadonlyReferencesContextKey.bindTo(contextKeyService);
|
|
138
|
-
const setReadonlyFilesEnabled = () => {
|
|
139
|
-
const enabled = productService.quality !== 'stable' && ( extensionService.extensions.some(e => e.enabledApiProposals?.includes('chatReadonlyPromptReference')));
|
|
140
|
-
readonlyEnabledContextKey.set(enabled);
|
|
141
|
-
};
|
|
142
|
-
setReadonlyFilesEnabled();
|
|
143
|
-
this._register(extensionService.onDidRegisterExtensions(setReadonlyFilesEnabled));
|
|
144
|
-
this._register(extensionService.onDidChangeExtensions(setReadonlyFilesEnabled));
|
|
145
|
-
this._register(this.lifecycleService.onWillShutdown((e) => {
|
|
146
|
-
const session = this._currentSessionObs.get();
|
|
147
|
-
if (session) {
|
|
148
|
-
storageService.store(STORAGE_KEY_EDITING_SESSION, session.chatSessionId, StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
149
|
-
e.join(session.storeState(), { id: 'join.chatEditingSession', label: ( localize(4500, "Saving chat edits history")) });
|
|
150
|
-
}
|
|
151
|
-
}));
|
|
152
|
-
this._editingSessionFileLimitPromise = this._workbenchAssignmentService.getTreatment(chatEditingMaxFileAssignmentName).then(value => {
|
|
153
|
-
this._editingSessionFileLimit = value ?? defaultChatEditingMaxFileLimit;
|
|
154
|
-
return this._editingSessionFileLimit;
|
|
155
|
-
});
|
|
156
|
-
const sessionIdToRestore = storageService.get(STORAGE_KEY_EDITING_SESSION, StorageScope.WORKSPACE);
|
|
157
|
-
if (isString(sessionIdToRestore)) {
|
|
158
|
-
if (this._chatService.getOrRestoreSession(sessionIdToRestore)) {
|
|
159
|
-
this._restoringEditingSession = this.startOrContinueEditingSession(sessionIdToRestore);
|
|
160
|
-
this._restoringEditingSession.finally(() => {
|
|
161
|
-
this._restoringEditingSession = undefined;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
logService.error(`Edit session session to restore is a non-existing chat session: ${sessionIdToRestore}`);
|
|
166
|
-
}
|
|
167
|
-
storageService.remove(STORAGE_KEY_EDITING_SESSION, StorageScope.WORKSPACE);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
async getOrRestoreEditingSession() {
|
|
171
|
-
if (this._restoringEditingSession) {
|
|
172
|
-
await this._restoringEditingSession;
|
|
173
|
-
}
|
|
174
|
-
return this.currentEditingSessionObs.get();
|
|
175
|
-
}
|
|
176
|
-
dispose() {
|
|
177
|
-
this._currentSessionObs.get()?.dispose();
|
|
178
|
-
super.dispose();
|
|
179
|
-
}
|
|
180
|
-
async startOrContinueEditingSession(chatSessionId) {
|
|
181
|
-
await this._restoringEditingSession;
|
|
182
|
-
const session = this._currentSessionObs.get();
|
|
183
|
-
if (session) {
|
|
184
|
-
if (session.chatSessionId === chatSessionId) {
|
|
185
|
-
return session;
|
|
186
|
-
}
|
|
187
|
-
else if (session.chatSessionId !== chatSessionId) {
|
|
188
|
-
await session.stop(true);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return this._createEditingSession(chatSessionId);
|
|
192
|
-
}
|
|
193
|
-
_lookupEntry(uri) {
|
|
194
|
-
for (const item of Iterable.concat(this.editingSessionsObs.get())) {
|
|
195
|
-
const candidate = item.getEntry(uri);
|
|
196
|
-
if (candidate instanceof ChatEditingModifiedFileEntry) {
|
|
197
|
-
return candidate.acquire();
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return undefined;
|
|
201
|
-
}
|
|
202
|
-
async _createEditingSession(chatSessionId) {
|
|
203
|
-
if (this._currentSessionObs.get()) {
|
|
204
|
-
throw ( new BugIndicatingError('Cannot have more than one active editing session'));
|
|
205
|
-
}
|
|
206
|
-
this._currentSessionDisposables.clear();
|
|
207
|
-
const session = this._instantiationService.createInstance(ChatEditingSession, chatSessionId, true, this._editingSessionFileLimitPromise, this._lookupEntry.bind(this));
|
|
208
|
-
await session.init();
|
|
209
|
-
this._currentSessionDisposables.add(this.installAutoApplyObserver(session));
|
|
210
|
-
this._currentSessionDisposables.add(session.onDidDispose(() => {
|
|
211
|
-
this._currentSessionDisposables.clear();
|
|
212
|
-
this._currentSessionObs.set(null, undefined);
|
|
213
|
-
}));
|
|
214
|
-
this._currentSessionObs.set(session, undefined);
|
|
215
|
-
return session;
|
|
216
|
-
}
|
|
217
|
-
async createAdhocEditingSession(chatSessionId) {
|
|
218
|
-
const session = this._instantiationService.createInstance(ChatEditingSession, chatSessionId, false, this._editingSessionFileLimitPromise, this._lookupEntry.bind(this));
|
|
219
|
-
await session.init();
|
|
220
|
-
const list = this._adhocSessionsObs.get();
|
|
221
|
-
const removeSession = list.unshift(session);
|
|
222
|
-
const store = ( new DisposableStore());
|
|
223
|
-
this._store.add(store);
|
|
224
|
-
store.add(this.installAutoApplyObserver(session));
|
|
225
|
-
store.add(session.onDidDispose(e => {
|
|
226
|
-
removeSession();
|
|
227
|
-
this._adhocSessionsObs.set(list, undefined);
|
|
228
|
-
this._store.deleteAndLeak(store);
|
|
229
|
-
store.dispose();
|
|
230
|
-
}));
|
|
231
|
-
this._adhocSessionsObs.set(list, undefined);
|
|
232
|
-
return session;
|
|
233
|
-
}
|
|
234
|
-
installAutoApplyObserver(session) {
|
|
235
|
-
const chatModel = this._chatService.getOrRestoreSession(session.chatSessionId);
|
|
236
|
-
if (!chatModel) {
|
|
237
|
-
throw ( new ErrorNoTelemetry(
|
|
238
|
-
`Edit session was created for a non-existing chat session: ${session.chatSessionId}`
|
|
239
|
-
));
|
|
240
|
-
}
|
|
241
|
-
const observerDisposables = ( new DisposableStore());
|
|
242
|
-
let editsSource;
|
|
243
|
-
let editsPromise;
|
|
244
|
-
const editsSeen = ( new ResourceMap());
|
|
245
|
-
const editedFilesExist = ( new ResourceMap());
|
|
246
|
-
const onResponseComplete = (responseModel) => {
|
|
247
|
-
if (responseModel.result?.errorDetails && !responseModel.result.errorDetails.responseIsIncomplete) {
|
|
248
|
-
session.restoreSnapshot(responseModel.requestId);
|
|
249
|
-
this._applyingChatEditsFailedContextKey.set(true);
|
|
250
|
-
}
|
|
251
|
-
editsSource?.resolve();
|
|
252
|
-
editsSource = undefined;
|
|
253
|
-
editsSeen.clear();
|
|
254
|
-
editedFilesExist.clear();
|
|
255
|
-
};
|
|
256
|
-
const handleResponseParts = async (responseModel) => {
|
|
257
|
-
for (const part of responseModel.response.value) {
|
|
258
|
-
if (part.kind === 'codeblockUri' || part.kind === 'textEditGroup') {
|
|
259
|
-
if (!editedFilesExist.get(part.uri)) {
|
|
260
|
-
const uri = part.uri.scheme === Schemas.vscodeNotebookCell ? CellUri.parse(part.uri)?.notebook ?? part.uri : part.uri;
|
|
261
|
-
editedFilesExist.set(part.uri, this._fileService.exists(uri).then((e) => {
|
|
262
|
-
if (e) {
|
|
263
|
-
this._editorService.openEditor({ resource: uri, options: { inactive: true, preserveFocus: true, pinned: true } });
|
|
264
|
-
}
|
|
265
|
-
return e;
|
|
266
|
-
}));
|
|
267
|
-
}
|
|
268
|
-
const first = editsSeen.size === 0;
|
|
269
|
-
let entry = editsSeen.get(part.uri);
|
|
270
|
-
if (!entry) {
|
|
271
|
-
entry = { seen: 0 };
|
|
272
|
-
editsSeen.set(part.uri, entry);
|
|
273
|
-
}
|
|
274
|
-
const allEdits = part.kind === 'textEditGroup' ? part.edits : [];
|
|
275
|
-
const newEdits = allEdits.slice(entry.seen);
|
|
276
|
-
entry.seen += newEdits.length;
|
|
277
|
-
if (newEdits.length > 0 || entry.seen === 0) {
|
|
278
|
-
editsSource ??= ( new AsyncIterableSource());
|
|
279
|
-
editsSource.emitOne({ uri: part.uri, edits: newEdits, kind: 'textEditGroup', done: part.kind === 'textEditGroup' && part.done });
|
|
280
|
-
}
|
|
281
|
-
if (first) {
|
|
282
|
-
await editsPromise;
|
|
283
|
-
editsPromise = this._continueEditingSession(session, async (builder, token) => {
|
|
284
|
-
for await (const item of editsSource.asyncIterable) {
|
|
285
|
-
if (responseModel.isCanceled) {
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
if (token.isCancellationRequested) {
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
if (item.edits.length === 0) {
|
|
292
|
-
builder.textEdits(item.uri, [], item.done ?? false, responseModel);
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
for (let i = 0; i < item.edits.length; i++) {
|
|
296
|
-
const group = item.edits[i];
|
|
297
|
-
const isLastGroup = i === item.edits.length - 1;
|
|
298
|
-
builder.textEdits(item.uri, group, isLastGroup && (item.done ?? false), responseModel);
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}).finally(() => {
|
|
302
|
-
editsPromise = undefined;
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
observerDisposables.add(chatModel.onDidChange(async (e) => {
|
|
309
|
-
if (e.kind === 'addRequest') {
|
|
310
|
-
session.createSnapshot(e.request.id);
|
|
311
|
-
this._applyingChatEditsFailedContextKey.set(false);
|
|
312
|
-
const responseModel = e.request.response;
|
|
313
|
-
if (responseModel) {
|
|
314
|
-
if (responseModel.isComplete) {
|
|
315
|
-
await handleResponseParts(responseModel);
|
|
316
|
-
onResponseComplete(responseModel);
|
|
317
|
-
}
|
|
318
|
-
else {
|
|
319
|
-
const disposable = responseModel.onDidChange(async () => {
|
|
320
|
-
await handleResponseParts(responseModel);
|
|
321
|
-
if (responseModel.isComplete) {
|
|
322
|
-
onResponseComplete(responseModel);
|
|
323
|
-
disposable.dispose();
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
}));
|
|
330
|
-
observerDisposables.add(chatModel.onDidDispose(() => observerDisposables.dispose()));
|
|
331
|
-
return observerDisposables;
|
|
332
|
-
}
|
|
333
|
-
async _continueEditingSession(session, builder) {
|
|
334
|
-
if (session.state.get() === ChatEditingSessionState.StreamingEdits) {
|
|
335
|
-
throw ( new BugIndicatingError('Cannot continue session that is still streaming'));
|
|
336
|
-
}
|
|
337
|
-
const stream = {
|
|
338
|
-
textEdits: (resource, textEdits, isDone, responseModel) => {
|
|
339
|
-
session.acceptTextEdits(resource, textEdits, isDone, responseModel);
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
session.acceptStreamingEditsStart();
|
|
343
|
-
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
344
|
-
this._currentAutoApplyOperationObs.set(cancellationTokenSource, undefined);
|
|
345
|
-
try {
|
|
346
|
-
await builder(stream, cancellationTokenSource.token);
|
|
347
|
-
}
|
|
348
|
-
finally {
|
|
349
|
-
cancellationTokenSource.dispose();
|
|
350
|
-
this._currentAutoApplyOperationObs.set(null, undefined);
|
|
351
|
-
session.resolve();
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
hasRelatedFilesProviders() {
|
|
355
|
-
return this._chatRelatedFilesProviders.size > 0;
|
|
356
|
-
}
|
|
357
|
-
registerRelatedFilesProvider(handle, provider) {
|
|
358
|
-
this._chatRelatedFilesProviders.set(handle, provider);
|
|
359
|
-
return toDisposable(() => {
|
|
360
|
-
this._chatRelatedFilesProviders.delete(handle);
|
|
361
|
-
});
|
|
362
|
-
}
|
|
363
|
-
async getRelatedFiles(chatSessionId, prompt, token) {
|
|
364
|
-
const currentSession = this._currentSessionObs.get();
|
|
365
|
-
if (!currentSession || chatSessionId !== currentSession.chatSessionId) {
|
|
366
|
-
return undefined;
|
|
367
|
-
}
|
|
368
|
-
const userAddedWorkingSetEntries = [];
|
|
369
|
-
for (const [uri, metadata] of currentSession.workingSet) {
|
|
370
|
-
if (metadata.state !== WorkingSetEntryState.Suggested) {
|
|
371
|
-
userAddedWorkingSetEntries.push(uri);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
const providers = Array.from(( this._chatRelatedFilesProviders.values()));
|
|
375
|
-
const result = await Promise.all(( providers.map(async (provider) => {
|
|
376
|
-
try {
|
|
377
|
-
const relatedFiles = await provider.provideRelatedFiles({ prompt, files: userAddedWorkingSetEntries }, token);
|
|
378
|
-
if (relatedFiles?.length) {
|
|
379
|
-
return { group: provider.description, files: relatedFiles };
|
|
380
|
-
}
|
|
381
|
-
return undefined;
|
|
382
|
-
}
|
|
383
|
-
catch (e) {
|
|
384
|
-
return undefined;
|
|
385
|
-
}
|
|
386
|
-
})));
|
|
387
|
-
return coalesce(result);
|
|
388
|
-
}
|
|
389
|
-
};
|
|
390
|
-
ChatEditingService = ( __decorate([
|
|
391
|
-
( __param(0, IInstantiationService)),
|
|
392
|
-
( __param(1, IMultiDiffSourceResolverService)),
|
|
393
|
-
( __param(2, ITextModelService)),
|
|
394
|
-
( __param(3, IContextKeyService)),
|
|
395
|
-
( __param(4, IChatService)),
|
|
396
|
-
( __param(5, IEditorService)),
|
|
397
|
-
( __param(6, IDecorationsService)),
|
|
398
|
-
( __param(7, IFileService)),
|
|
399
|
-
( __param(8, ILifecycleService)),
|
|
400
|
-
( __param(9, IWorkbenchAssignmentService)),
|
|
401
|
-
( __param(10, IChatAgentService)),
|
|
402
|
-
( __param(11, IStorageService)),
|
|
403
|
-
( __param(12, ILogService)),
|
|
404
|
-
( __param(13, IExtensionService)),
|
|
405
|
-
( __param(14, IProductService))
|
|
406
|
-
], ChatEditingService));
|
|
407
|
-
function observeArrayChanges(obs, compare, store) {
|
|
408
|
-
const emitter = store.add(( new Emitter()));
|
|
409
|
-
store.add(runOnChange(obs, (newArr, oldArr) => {
|
|
410
|
-
const change = delta(oldArr || [], newArr, compare);
|
|
411
|
-
const changedElements = [].concat(change.added).concat(change.removed);
|
|
412
|
-
emitter.fire(changedElements);
|
|
413
|
-
}));
|
|
414
|
-
return emitter.event;
|
|
415
|
-
}
|
|
416
|
-
let ChatDecorationsProvider = class ChatDecorationsProvider extends Disposable {
|
|
417
|
-
constructor(_session, _chatAgentService) {
|
|
418
|
-
super();
|
|
419
|
-
this._session = _session;
|
|
420
|
-
this._chatAgentService = _chatAgentService;
|
|
421
|
-
this.label = ( localize(4501, "Chat Editing"));
|
|
422
|
-
this._currentEntries = derived(this, (r) => {
|
|
423
|
-
const session = this._session.read(r);
|
|
424
|
-
if (!session) {
|
|
425
|
-
return [];
|
|
426
|
-
}
|
|
427
|
-
const state = session.state.read(r);
|
|
428
|
-
if (state === ChatEditingSessionState.Disposed) {
|
|
429
|
-
return [];
|
|
430
|
-
}
|
|
431
|
-
return session.entries.read(r);
|
|
432
|
-
});
|
|
433
|
-
this._currentlyEditingUris = derived(this, (r) => {
|
|
434
|
-
const uri = this._currentEntries.read(r);
|
|
435
|
-
return ( uri.filter(entry => entry.isCurrentlyBeingModified.read(r)).map(entry => entry.modifiedURI));
|
|
436
|
-
});
|
|
437
|
-
this._modifiedUris = derived(this, (r) => {
|
|
438
|
-
const uri = this._currentEntries.read(r);
|
|
439
|
-
return ( uri.filter(entry => !entry.isCurrentlyBeingModified.read(r) && entry.state.read(r) === WorkingSetEntryState.Modified).map(entry => entry.modifiedURI));
|
|
440
|
-
});
|
|
441
|
-
this.onDidChange = Event.any(observeArrayChanges(this._currentlyEditingUris, compareBy(uri => ( uri.toString()), compare), this._store), observeArrayChanges(this._modifiedUris, compareBy(uri => ( uri.toString()), compare), this._store));
|
|
442
|
-
}
|
|
443
|
-
provideDecorations(uri, _token) {
|
|
444
|
-
const isCurrentlyBeingModified = ( this._currentlyEditingUris.get().some(e => ( e.toString()) === ( uri.toString())));
|
|
445
|
-
if (isCurrentlyBeingModified) {
|
|
446
|
-
return {
|
|
447
|
-
weight: 1000,
|
|
448
|
-
letter: ThemeIcon.modify(Codicon.loading, 'spin'),
|
|
449
|
-
bubble: false
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
const isModified = ( this._modifiedUris.get().some(e => ( e.toString()) === ( uri.toString())));
|
|
453
|
-
if (isModified) {
|
|
454
|
-
const defaultAgentName = this._chatAgentService.getDefaultAgent(ChatAgentLocation.EditingSession)?.fullName;
|
|
455
|
-
return {
|
|
456
|
-
weight: 1000,
|
|
457
|
-
letter: Codicon.diffModified,
|
|
458
|
-
tooltip: defaultAgentName ? ( localize(4502, "Pending changes from {0}", defaultAgentName)) : ( localize(4503, "Pending changes from chat")),
|
|
459
|
-
bubble: true
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
return undefined;
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
ChatDecorationsProvider = ( __decorate([
|
|
466
|
-
( __param(1, IChatAgentService))
|
|
467
|
-
], ChatDecorationsProvider));
|
|
468
|
-
let ChatEditingMultiDiffSourceResolver = class ChatEditingMultiDiffSourceResolver {
|
|
469
|
-
constructor(_currentSession, _instantiationService) {
|
|
470
|
-
this._currentSession = _currentSession;
|
|
471
|
-
this._instantiationService = _instantiationService;
|
|
472
|
-
}
|
|
473
|
-
canHandleUri(uri) {
|
|
474
|
-
return uri.scheme === CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME;
|
|
475
|
-
}
|
|
476
|
-
async resolveDiffSource(uri) {
|
|
477
|
-
return this._instantiationService.createInstance(ChatEditingMultiDiffSource, this._currentSession);
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
ChatEditingMultiDiffSourceResolver = ( __decorate([
|
|
481
|
-
( __param(1, IInstantiationService))
|
|
482
|
-
], ChatEditingMultiDiffSourceResolver));
|
|
483
|
-
class ChatEditingMultiDiffSource {
|
|
484
|
-
constructor(_currentSession) {
|
|
485
|
-
this._currentSession = _currentSession;
|
|
486
|
-
this._resources = derived(this, (reader) => {
|
|
487
|
-
const currentSession = this._currentSession.read(reader);
|
|
488
|
-
if (!currentSession) {
|
|
489
|
-
return [];
|
|
490
|
-
}
|
|
491
|
-
const entries = currentSession.entries.read(reader);
|
|
492
|
-
return ( entries.map((entry) => {
|
|
493
|
-
return ( new MultiDiffEditorItem(entry.originalURI, entry.modifiedURI, undefined, {
|
|
494
|
-
[chatEditingResourceContextKey.key]: entry.entryId,
|
|
495
|
-
}));
|
|
496
|
-
}));
|
|
497
|
-
});
|
|
498
|
-
this.resources = ( new ValueWithChangeEventFromObservable(this._resources));
|
|
499
|
-
this.contextKeys = {
|
|
500
|
-
[inChatEditingSessionContextKey.key]: true
|
|
501
|
-
};
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
export { ChatEditingMultiDiffSourceResolver, ChatEditingService };
|
|
@@ -1,104 +0,0 @@
|
|
|
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";
|
|
6
|
-
import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
7
|
-
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
|
|
8
|
-
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
9
|
-
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model";
|
|
10
|
-
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService";
|
|
11
|
-
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
12
|
-
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
13
|
-
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
14
|
-
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
15
|
-
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
16
|
-
import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
|
|
17
|
-
import { ChatEditingSessionChangeType, ChatEditingSessionState, IChatEditingSession, IModifiedFileEntry, WorkingSetDisplayMetadata, WorkingSetEntryRemovalReason, WorkingSetEntryState } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
18
|
-
import { IChatResponseModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
19
|
-
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
20
|
-
import { ChatEditingModifiedFileEntry, ISnapshotEntry } from "@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry";
|
|
21
|
-
export declare class ChatEditingSession extends Disposable implements IChatEditingSession {
|
|
22
|
-
readonly chatSessionId: string;
|
|
23
|
-
readonly isGlobalEditingSession: boolean;
|
|
24
|
-
private editingSessionFileLimitPromise;
|
|
25
|
-
private _lookupExternalEntry;
|
|
26
|
-
private readonly _instantiationService;
|
|
27
|
-
private readonly _modelService;
|
|
28
|
-
private readonly _languageService;
|
|
29
|
-
private readonly _textModelService;
|
|
30
|
-
readonly _bulkEditService: IBulkEditService;
|
|
31
|
-
private readonly _editorGroupsService;
|
|
32
|
-
private readonly _editorService;
|
|
33
|
-
private readonly _chatService;
|
|
34
|
-
private readonly _notebookService;
|
|
35
|
-
private readonly _textFileService;
|
|
36
|
-
private readonly _chatAgentService;
|
|
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 ChatEditingModifiedFileEntry[]>;
|
|
43
|
-
private readonly _sequencer;
|
|
44
|
-
private _workingSet;
|
|
45
|
-
get workingSet(): ResourceMap<WorkingSetDisplayMetadata>;
|
|
46
|
-
private _removedTransientEntries;
|
|
47
|
-
private _editorPane;
|
|
48
|
-
get state(): IObservable<ChatEditingSessionState>;
|
|
49
|
-
readonly canUndo: IObservable<boolean>;
|
|
50
|
-
readonly canRedo: IObservable<boolean>;
|
|
51
|
-
hiddenRequestIds: IObservable<string[]>;
|
|
52
|
-
private readonly _onDidChange;
|
|
53
|
-
get onDidChange(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<ChatEditingSessionChangeType>;
|
|
54
|
-
private readonly _onDidDispose;
|
|
55
|
-
get onDidDispose(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
56
|
-
private _isToolsAgentSession;
|
|
57
|
-
get isToolsAgentSession(): boolean;
|
|
58
|
-
constructor(chatSessionId: string, isGlobalEditingSession: boolean, editingSessionFileLimitPromise: Promise<number>, _lookupExternalEntry: (uri: URI) => ChatEditingModifiedFileEntry | undefined, _instantiationService: IInstantiationService, _modelService: IModelService, _languageService: ILanguageService, _textModelService: ITextModelService, _bulkEditService: IBulkEditService, _editorGroupsService: IEditorGroupsService, _editorService: IEditorService, _chatService: IChatService, _notebookService: INotebookService, _textFileService: ITextFileService, _chatAgentService: IChatAgentService);
|
|
59
|
-
init(): Promise<void>;
|
|
60
|
-
getEntry(uri: URI): IModifiedFileEntry | undefined;
|
|
61
|
-
readEntry(uri: URI, reader: IReader | undefined): IModifiedFileEntry | undefined;
|
|
62
|
-
storeState(): Promise<void>;
|
|
63
|
-
private _triggerSaveParticipantsOnAccept;
|
|
64
|
-
private _trackCurrentEditorsInWorkingSet;
|
|
65
|
-
private _findSnapshot;
|
|
66
|
-
createSnapshot(requestId: string | undefined): void;
|
|
67
|
-
private _createSnapshot;
|
|
68
|
-
getSnapshotModel(requestId: string, snapshotUri: URI): Promise<ITextModel | null>;
|
|
69
|
-
getSnapshot(requestId: string, uri: URI): ISnapshotEntry | undefined;
|
|
70
|
-
getSnapshotUri(requestId: string, uri: URI): URI | undefined;
|
|
71
|
-
private _pendingSnapshot;
|
|
72
|
-
restoreSnapshot(requestId: string | undefined): Promise<void>;
|
|
73
|
-
private _restoreSnapshot;
|
|
74
|
-
remove(reason: WorkingSetEntryRemovalReason, ...uris: URI[]): void;
|
|
75
|
-
markIsReadonly(resource: URI, isReadonly?: boolean): void;
|
|
76
|
-
private _assertNotDisposed;
|
|
77
|
-
accept(...uris: URI[]): Promise<void>;
|
|
78
|
-
reject(...uris: URI[]): Promise<void>;
|
|
79
|
-
show(): Promise<void>;
|
|
80
|
-
private stopPromise;
|
|
81
|
-
stop(clearState?: boolean): Promise<void>;
|
|
82
|
-
_performStop(): Promise<void>;
|
|
83
|
-
dispose(): void;
|
|
84
|
-
getVirtualModel(documentId: string): ITextModel | null;
|
|
85
|
-
acceptStreamingEditsStart(): void;
|
|
86
|
-
acceptTextEdits(resource: URI, textEdits: TextEdit[], isLastEdits: boolean, responseModel: IChatResponseModel): void;
|
|
87
|
-
resolve(): void;
|
|
88
|
-
private _trackUntitledWorkingSetEntry;
|
|
89
|
-
addFileToWorkingSet(resource: URI, description?: string, proposedState?: WorkingSetEntryState.Suggested): void;
|
|
90
|
-
undoInteraction(): Promise<void>;
|
|
91
|
-
redoInteraction(): Promise<void>;
|
|
92
|
-
private _updateRequestHiddenState;
|
|
93
|
-
private _acceptStreamingEditsStart;
|
|
94
|
-
private _acceptTextEdits;
|
|
95
|
-
private _resolve;
|
|
96
|
-
private _getOrCreateModifiedFileEntry;
|
|
97
|
-
private _createModifiedFileEntry;
|
|
98
|
-
private _collapse;
|
|
99
|
-
}
|
|
100
|
-
export interface IChatEditingSessionSnapshot {
|
|
101
|
-
readonly requestId: string | undefined;
|
|
102
|
-
readonly workingSet: ResourceMap<WorkingSetDisplayMetadata>;
|
|
103
|
-
readonly entries: ResourceMap<ISnapshotEntry>;
|
|
104
|
-
}
|