@codingame/monaco-vscode-chat-service-override 3.2.3 → 4.1.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/chat.js +16 -14
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +16 -0
- package/external/tslib/tslib.es6.js +0 -11
- package/external/vscode-marked/lib/marked.esm.js +0 -2200
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +0 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +0 -115
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +0 -501
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +0 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +0 -171
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +0 -271
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +0 -299
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +0 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +0 -179
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +0 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +0 -271
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +0 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +0 -174
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatHistoryVariables.js +0 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +0 -580
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +0 -36
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +0 -601
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +0 -43
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +0 -41
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +0 -814
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +0 -72
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +0 -236
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -223
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChatServiceImpl.js +0 -33
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
5
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
|
-
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
7
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
-
import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
9
|
-
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
10
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
11
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
12
|
-
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
13
|
-
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
14
|
-
import { editorBackground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
|
|
15
|
-
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
16
|
-
import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
17
|
-
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
18
|
-
import { SIDE_BAR_FOREGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
19
|
-
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
20
|
-
import { ChatWidget } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
21
|
-
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
22
|
-
|
|
23
|
-
const CHAT_SIDEBAR_PANEL_ID = 'workbench.panel.chatSidebar';
|
|
24
|
-
let ChatViewPane = class ChatViewPane extends ViewPane {
|
|
25
|
-
static { this.ID = 'workbench.panel.chat.view'; }
|
|
26
|
-
get widget() { return this._widget; }
|
|
27
|
-
constructor(chatViewOptions, options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, storageService, chatService, logService) {
|
|
28
|
-
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
29
|
-
this.chatViewOptions = chatViewOptions;
|
|
30
|
-
this.storageService = storageService;
|
|
31
|
-
this.chatService = chatService;
|
|
32
|
-
this.logService = logService;
|
|
33
|
-
this.modelDisposables = this._register(( new DisposableStore()));
|
|
34
|
-
this.didProviderRegistrationFail = false;
|
|
35
|
-
this.didUnregisterProvider = false;
|
|
36
|
-
this.memento = ( new Memento(
|
|
37
|
-
'interactive-session-view-' + this.chatViewOptions.providerId,
|
|
38
|
-
this.storageService
|
|
39
|
-
));
|
|
40
|
-
this.viewState = this.memento.getMemento(1 , 1 );
|
|
41
|
-
this._register(this.chatService.onDidRegisterProvider(({ providerId }) => {
|
|
42
|
-
if (providerId === this.chatViewOptions.providerId && !this._widget?.viewModel) {
|
|
43
|
-
const sessionId = this.getSessionId();
|
|
44
|
-
const model = sessionId ? this.chatService.getOrRestoreSession(sessionId) : undefined;
|
|
45
|
-
try {
|
|
46
|
-
this._widget.setVisible(false);
|
|
47
|
-
this.updateModel(model);
|
|
48
|
-
this.didProviderRegistrationFail = false;
|
|
49
|
-
this.didUnregisterProvider = false;
|
|
50
|
-
this._onDidChangeViewWelcomeState.fire();
|
|
51
|
-
}
|
|
52
|
-
finally {
|
|
53
|
-
this.widget.setVisible(true);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}));
|
|
57
|
-
this._register(this.chatService.onDidUnregisterProvider(({ providerId }) => {
|
|
58
|
-
if (providerId === this.chatViewOptions.providerId) {
|
|
59
|
-
this.didUnregisterProvider = true;
|
|
60
|
-
this._onDidChangeViewWelcomeState.fire();
|
|
61
|
-
}
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
updateModel(model, viewState) {
|
|
65
|
-
this.modelDisposables.clear();
|
|
66
|
-
model = model ?? (this.chatService.transferredSessionData?.sessionId
|
|
67
|
-
? this.chatService.getOrRestoreSession(this.chatService.transferredSessionData.sessionId)
|
|
68
|
-
: this.chatService.startSession(this.chatViewOptions.providerId, CancellationToken.None));
|
|
69
|
-
if (!model) {
|
|
70
|
-
throw new Error('Could not start chat session');
|
|
71
|
-
}
|
|
72
|
-
this._widget.setModel(model, { ...(viewState ?? this.viewState) });
|
|
73
|
-
this.viewState.sessionId = model.sessionId;
|
|
74
|
-
}
|
|
75
|
-
shouldShowWelcome() {
|
|
76
|
-
const noPersistedSessions = !this.chatService.hasSessions(this.chatViewOptions.providerId);
|
|
77
|
-
return this.didUnregisterProvider || !this._widget?.viewModel && (noPersistedSessions || this.didProviderRegistrationFail);
|
|
78
|
-
}
|
|
79
|
-
getSessionId() {
|
|
80
|
-
let sessionId;
|
|
81
|
-
if (this.chatService.transferredSessionData) {
|
|
82
|
-
sessionId = this.chatService.transferredSessionData.sessionId;
|
|
83
|
-
this.viewState.inputValue = this.chatService.transferredSessionData.inputValue;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
sessionId = this.viewState.sessionId;
|
|
87
|
-
}
|
|
88
|
-
return sessionId;
|
|
89
|
-
}
|
|
90
|
-
renderBody(parent) {
|
|
91
|
-
try {
|
|
92
|
-
super.renderBody(parent);
|
|
93
|
-
const scopedInstantiationService = this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.scopedContextKeyService])));
|
|
94
|
-
this._widget = this._register(scopedInstantiationService.createInstance(ChatWidget, { viewId: this.id }, { supportsFileReferences: true }, {
|
|
95
|
-
listForeground: SIDE_BAR_FOREGROUND,
|
|
96
|
-
listBackground: this.getBackgroundColor(),
|
|
97
|
-
inputEditorBackground: this.getBackgroundColor(),
|
|
98
|
-
resultEditorBackground: editorBackground
|
|
99
|
-
}));
|
|
100
|
-
this._register(this.onDidChangeBodyVisibility(visible => {
|
|
101
|
-
this._widget.setVisible(visible);
|
|
102
|
-
}));
|
|
103
|
-
this._register(this._widget.onDidClear(() => this.clear()));
|
|
104
|
-
this._widget.render(parent);
|
|
105
|
-
const sessionId = this.getSessionId();
|
|
106
|
-
const disposeListener = sessionId ? this._register(this.chatService.onDidDisposeSession((e) => {
|
|
107
|
-
if (e.reason === 'initializationFailed' && e.providerId === this.chatViewOptions.providerId) {
|
|
108
|
-
this.didProviderRegistrationFail = true;
|
|
109
|
-
disposeListener?.dispose();
|
|
110
|
-
this._onDidChangeViewWelcomeState.fire();
|
|
111
|
-
}
|
|
112
|
-
})) : undefined;
|
|
113
|
-
const model = sessionId ? this.chatService.getOrRestoreSession(sessionId) : undefined;
|
|
114
|
-
this.updateModel(model);
|
|
115
|
-
}
|
|
116
|
-
catch (e) {
|
|
117
|
-
this.logService.error(e);
|
|
118
|
-
throw e;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
acceptInput(query) {
|
|
122
|
-
this._widget.acceptInput(query);
|
|
123
|
-
}
|
|
124
|
-
async clear() {
|
|
125
|
-
if (this.widget.viewModel) {
|
|
126
|
-
this.chatService.clearSession(this.widget.viewModel.sessionId);
|
|
127
|
-
}
|
|
128
|
-
this.updateModel(undefined, { ...this.viewState, inputValue: undefined });
|
|
129
|
-
}
|
|
130
|
-
loadSession(sessionId) {
|
|
131
|
-
if (this.widget.viewModel) {
|
|
132
|
-
this.chatService.clearSession(this.widget.viewModel.sessionId);
|
|
133
|
-
}
|
|
134
|
-
const newModel = this.chatService.getOrRestoreSession(sessionId);
|
|
135
|
-
this.updateModel(newModel);
|
|
136
|
-
}
|
|
137
|
-
focusInput() {
|
|
138
|
-
this._widget.focusInput();
|
|
139
|
-
}
|
|
140
|
-
focus() {
|
|
141
|
-
super.focus();
|
|
142
|
-
this._widget.focusInput();
|
|
143
|
-
}
|
|
144
|
-
layoutBody(height, width) {
|
|
145
|
-
super.layoutBody(height, width);
|
|
146
|
-
this._widget.layout(height, width);
|
|
147
|
-
}
|
|
148
|
-
saveState() {
|
|
149
|
-
if (this._widget) {
|
|
150
|
-
this._widget.saveState();
|
|
151
|
-
const widgetViewState = this._widget.getViewState();
|
|
152
|
-
this.viewState.inputValue = widgetViewState.inputValue;
|
|
153
|
-
this.viewState.inputState = widgetViewState.inputState;
|
|
154
|
-
this.memento.saveMemento();
|
|
155
|
-
}
|
|
156
|
-
super.saveState();
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
ChatViewPane = ( __decorate([
|
|
160
|
-
( __param(2, IKeybindingService)),
|
|
161
|
-
( __param(3, IContextMenuService)),
|
|
162
|
-
( __param(4, IConfigurationService)),
|
|
163
|
-
( __param(5, IContextKeyService)),
|
|
164
|
-
( __param(6, IViewDescriptorService)),
|
|
165
|
-
( __param(7, IInstantiationService)),
|
|
166
|
-
( __param(8, IOpenerService)),
|
|
167
|
-
( __param(9, IThemeService)),
|
|
168
|
-
( __param(10, ITelemetryService)),
|
|
169
|
-
( __param(11, IStorageService)),
|
|
170
|
-
( __param(12, IChatService)),
|
|
171
|
-
( __param(13, ILogService))
|
|
172
|
-
], ChatViewPane));
|
|
173
|
-
|
|
174
|
-
export { CHAT_SIDEBAR_PANEL_ID, ChatViewPane };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
|
-
import { IChatVariablesService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatVariables';
|
|
6
|
-
|
|
7
|
-
let ChatHistoryVariables = class ChatHistoryVariables extends Disposable {
|
|
8
|
-
constructor(chatVariablesService) {
|
|
9
|
-
super();
|
|
10
|
-
this._register(chatVariablesService.registerVariable({ name: 'response', description: '', canTakeArgument: true, hidden: true }, async (message, arg, model, progress, token) => {
|
|
11
|
-
if (!arg) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
const responseNum = parseInt(arg, 10);
|
|
15
|
-
const response = model.getRequests()[responseNum - 1].response;
|
|
16
|
-
if (!response) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
return [{ level: 'full', value: response.response.asString() }];
|
|
20
|
-
}));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
ChatHistoryVariables = ( __decorate([
|
|
24
|
-
( __param(0, IChatVariablesService))
|
|
25
|
-
], ChatHistoryVariables));
|
|
26
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ChatHistoryVariables, 4 );
|