@codingame/monaco-vscode-api 1.82.6 → 1.83.0-next.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/api.js +5 -5
- package/assets/index-no-csp.html +2 -1
- package/assets/index.html +3 -2
- package/extensions.js +17 -14
- package/external/xterm/typings/xterm.d.ts +171 -109
- package/missing-services.js +33 -22
- package/monaco-editor-treemending.patch +1745 -1628
- package/monaco-treemending.js +2 -2
- package/monaco.js +2 -2
- package/package.json +2 -2
- package/service-override/extensions.js +10 -11
- package/services.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
- package/vscode/src/vs/base/common/event.d.ts +13 -17
- package/vscode/src/vs/base/common/keyCodes.d.ts +18 -18
- package/vscode/src/vs/base/common/lifecycle.d.ts +9 -0
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +2 -0
- package/vscode/src/vs/base/common/product.d.ts +1 -0
- package/vscode/src/vs/base/parts/ipc/common/ipc.js +6 -2
- package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -0
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +12 -3
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +0 -5
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +9 -2
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +6 -20
- package/vscode/src/vs/editor/common/diff/legacyLinesDiffComputer.d.ts +2 -2
- package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +5 -55
- package/vscode/src/vs/editor/common/diff/rangeMapping.d.ts +55 -0
- package/vscode/src/vs/editor/common/languages.d.ts +7 -10
- package/vscode/src/vs/editor/common/model.d.ts +1 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +5 -5
- package/vscode/src/vs/platform/files/common/fileService.js +46 -40
- package/vscode/src/vs/platform/files/common/files.d.ts +46 -1
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +45 -0
- package/vscode/src/vs/platform/storage/common/storage.d.ts +5 -0
- package/vscode/src/vs/platform/storage/common/storage.js +4 -0
- package/vscode/src/vs/platform/telemetry/common/telemetryUtils.js +4 -1
- package/vscode/src/vs/platform/terminal/common/terminal.js +1 -3
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +11 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents.js +50 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +16 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +20 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +3 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +93 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -166
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +18 -11
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +14 -9
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +11 -2
- package/vscode/src/vs/workbench/api/common/extHostChat.js +10 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +62 -0
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +13 -4
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +36 -4
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +6 -29
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +24 -12
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +0 -2
- package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +0 -63
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +80 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +24 -0
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +14 -10
- package/vscode/src/vs/workbench/api/common/extHostTextEditor.js +4 -4
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +11 -7
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +34 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +31 -13
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +14 -2
- package/vscode/src/vs/workbench/api/common/extHostWebviewPanels.js +11 -5
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +1 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +32 -9
- package/vscode/src/vs/workbench/browser/actions/quickAccessActions.js +3 -1
- package/vscode/src/vs/workbench/browser/codeeditor.js +1 -1
- package/vscode/src/vs/workbench/browser/dnd.js +7 -6
- package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +7 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +7 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +9 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +44 -14
- package/vscode/src/vs/workbench/browser/parts/editor/media/editorplaceholder.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -19
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -3
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +10 -9
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +2 -0
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -5
- package/vscode/src/vs/workbench/browser/web.api.d.ts +0 -6
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +34 -3
- package/vscode/src/vs/workbench/common/contextkeys.js +2 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +4 -4
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorInput.js +2 -4
- package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +0 -1
- package/vscode/src/vs/workbench/common/editor/editorModel.js +1 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +2 -0
- package/vscode/src/vs/workbench/common/theme.js +21 -1
- package/vscode/src/vs/workbench/common/views.d.ts +1 -1
- package/vscode/src/vs/workbench/common/views.js +1 -2
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +12 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +335 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +81 -27
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +1 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +136 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +14 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +78 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +43 -17
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +30 -26
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +23 -18
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +8 -8
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +55 -20
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +26 -10
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +7 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +58 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +9 -6
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +171 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +204 -33
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +3 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +21 -4
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debugUtils.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +7 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +7 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +17 -17
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +4 -1
- package/vscode/src/vs/workbench/contrib/output/browser/output.contribution.js +22 -19
- package/vscode/src/vs/workbench/contrib/output/browser/outputServices.js +2 -38
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +14 -1
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +3 -8
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +10 -12
- package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +0 -16
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +2 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +8 -6
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +2 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +2 -4
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +7 -3
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +2 -6
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -20
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +9 -13
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +2 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +47 -15
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +14 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +22 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +15 -14
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +12 -7
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +10 -6
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +27 -11
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +2 -5
- package/vscode/src/vs/workbench/services/extensions/common/remoteExtensionHost.js +7 -11
- package/vscode/src/vs/workbench/services/extensions/common/rpcProtocol.js +20 -4
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +24 -16
- package/vscode/src/vs/workbench/services/output/common/output.js +1 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +6 -6
- package/vscode/src/vs/workbench/services/preferences/common/preferences.js +4 -3
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.d.ts +0 -1
- package/vscode/src/vs/workbench/services/search/common/fileSearchManager.js +3 -1
- package/vscode/src/vs/workbench/services/search/common/search.js +2 -1
- package/vscode/src/vs/workbench/services/search/common/textSearchManager.js +1 -2
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileService.js +3 -8
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +3 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyService.js +4 -2
- package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +0 -180
- package/vscode/src/vs/platform/credentials/common/credentials.d.ts +0 -13
- package/vscode/src/vs/platform/credentials/common/credentials.js +0 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadKeytar.js +0 -31
- package/vscode/src/vs/workbench/browser/iframe.js +0 -16
- package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +0 -90
- package/vscode/src/vs/workbench/browser/parts/editor/tabFocus.js +0 -77
- package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +0 -67
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
3
|
import { ExtHostContext, MainContext } from '../common/extHost.protocol.js';
|
|
4
4
|
import { Extensions, IViewsService, NoTreeViewError, ResolvableTreeItem } from '../../common/views.js';
|
|
5
5
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
@@ -27,7 +27,9 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
27
27
|
this.logService.trace('MainThreadTreeViews#$registerTreeViewDataProvider', treeViewId, options);
|
|
28
28
|
this.extensionService.whenInstalledExtensionsRegistered().then(() => {
|
|
29
29
|
const dataProvider = ( new TreeViewDataProvider(treeViewId, this._proxy, this.notificationService));
|
|
30
|
-
|
|
30
|
+
const disposables = ( new DisposableStore());
|
|
31
|
+
this._register(disposables);
|
|
32
|
+
this._dataProviders.set(treeViewId, { dataProvider, disposables });
|
|
31
33
|
const dndController = (options.hasHandleDrag || options.hasHandleDrop)
|
|
32
34
|
? ( new TreeViewDragAndDropController(
|
|
33
35
|
treeViewId,
|
|
@@ -46,7 +48,7 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
46
48
|
this._dndControllers.set(treeViewId, dndController);
|
|
47
49
|
}
|
|
48
50
|
viewer.dataProvider = dataProvider;
|
|
49
|
-
this.registerListeners(treeViewId, viewer);
|
|
51
|
+
this.registerListeners(treeViewId, viewer, disposables);
|
|
50
52
|
this._proxy.$setVisible(treeViewId, viewer.visible);
|
|
51
53
|
}
|
|
52
54
|
else {
|
|
@@ -60,7 +62,7 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
60
62
|
.then(() => {
|
|
61
63
|
const viewer = this.getTreeView(treeViewId);
|
|
62
64
|
if (viewer && itemInfo) {
|
|
63
|
-
return this.reveal(viewer, this._dataProviders.get(treeViewId), itemInfo.item, itemInfo.parentChain, options);
|
|
65
|
+
return this.reveal(viewer, this._dataProviders.get(treeViewId).dataProvider, itemInfo.item, itemInfo.parentChain, options);
|
|
64
66
|
}
|
|
65
67
|
return undefined;
|
|
66
68
|
});
|
|
@@ -70,7 +72,7 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
70
72
|
const viewer = this.getTreeView(treeViewId);
|
|
71
73
|
const dataProvider = this._dataProviders.get(treeViewId);
|
|
72
74
|
if (viewer && dataProvider) {
|
|
73
|
-
const itemsToRefresh = dataProvider.getItemsToRefresh(itemsToRefreshByHandle);
|
|
75
|
+
const itemsToRefresh = dataProvider.dataProvider.getItemsToRefresh(itemsToRefreshByHandle);
|
|
74
76
|
return viewer.refresh(itemsToRefresh.length ? itemsToRefresh : undefined);
|
|
75
77
|
}
|
|
76
78
|
return Promise.resolve();
|
|
@@ -109,6 +111,11 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
109
111
|
if (viewer) {
|
|
110
112
|
viewer.dataProvider = undefined;
|
|
111
113
|
}
|
|
114
|
+
const dataProvider = this._dataProviders.get(treeViewId);
|
|
115
|
+
if (dataProvider) {
|
|
116
|
+
dataProvider.disposables.dispose();
|
|
117
|
+
this._dataProviders.delete(treeViewId);
|
|
118
|
+
}
|
|
112
119
|
}
|
|
113
120
|
async reveal(treeView, dataProvider, itemIn, parentChain, options) {
|
|
114
121
|
options = options ? options : { select: false, focus: false };
|
|
@@ -149,12 +156,12 @@ let MainThreadTreeViews = class MainThreadTreeViews extends Disposable {
|
|
|
149
156
|
}
|
|
150
157
|
}
|
|
151
158
|
}
|
|
152
|
-
registerListeners(treeViewId, treeView) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
registerListeners(treeViewId, treeView, disposables) {
|
|
160
|
+
disposables.add(treeView.onDidExpandItem(item => this._proxy.$setExpanded(treeViewId, item.handle, true)));
|
|
161
|
+
disposables.add(treeView.onDidCollapseItem(item => this._proxy.$setExpanded(treeViewId, item.handle, false)));
|
|
162
|
+
disposables.add(treeView.onDidChangeSelectionAndFocus(items => this._proxy.$setSelectionAndFocus(treeViewId, ( items.selection.map(({ handle }) => handle)), items.focus.handle)));
|
|
163
|
+
disposables.add(treeView.onDidChangeVisibility(isVisible => this._proxy.$setVisible(treeViewId, isVisible)));
|
|
164
|
+
disposables.add(treeView.onDidChangeCheckboxState(items => {
|
|
158
165
|
this._proxy.$changeCheckboxState(treeViewId, ( items.map(item => {
|
|
159
166
|
return { treeItemHandle: item.handle, newState: item.checkbox?.isChecked ?? false };
|
|
160
167
|
})));
|
|
@@ -37,7 +37,7 @@ import { IExtHostTerminalService } from './extHostTerminalService.js';
|
|
|
37
37
|
import { ExtHostEditors } from './extHostTextEditors.js';
|
|
38
38
|
import { ExtHostTreeViews } from './extHostTreeViews.js';
|
|
39
39
|
import { LanguageSelector } from './extHostTypeConverters.js';
|
|
40
|
-
import { Breakpoint, TerminalOutputAnchor, ChatMessage, ChatMessageRole, ChatVariableLevel, CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, CodeAction, CodeActionKind, CodeActionTriggerKind, CodeLens, Color, ColorInformation, ColorPresentation, ColorThemeKind, CommentMode, CommentState, CommentThreadCollapsibleState, CommentThreadState, CompletionItem, CompletionItemKind, CompletionItemTag, CompletionList, CompletionTriggerKind, ConfigurationTarget, CustomExecution, DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer, DebugConsoleMode, DecorationRangeBehavior, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, Disposable, DocumentHighlight, DocumentHighlightKind, DocumentLink, DocumentSymbol, EndOfLine, EnvironmentVariableMutatorType, EvaluatableExpression, InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression, InlineCompletionTriggerKind, ExtensionKind, ExtensionMode, ExternalUriOpenerPriority, FileChangeType, FileDecoration, FileSystemError, FoldingRange, FoldingRangeKind, FunctionBreakpoint, InlineSuggestion, InlineSuggestionList, Hover, Location, MarkdownString, ParameterInformation, PortAutoForwardAction, Position, ProcessExecution, ProgressLocation, QuickInputButtons, Range, RelativePattern, Selection, SelectionRange, SemanticTokens, SemanticTokensBuilder, SemanticTokensEdit, SemanticTokensEdits, SemanticTokensLegend, ShellExecution, ShellQuoting, SignatureHelp, SignatureHelpTriggerKind, SignatureInformation, SnippetString, SourceBreakpoint, StandardTokenType, StatusBarAlignment, SymbolInformation, SymbolKind, SymbolTag, Task, TaskGroup, TaskPanelKind, TaskRevealKind, TaskScope, TerminalLink, TerminalQuickFixCommand, TerminalQuickFixOpener, TerminalLocation, TerminalProfile, TerminalExitReason, TextDocumentSaveReason, TextEdit, SnippetTextEdit, TextEditorLineNumbersStyle, TextEditorRevealType, TextEditorSelectionChangeKind, TextDocumentChangeReason, ThemeColor, ThemeIcon, TreeItem, TreeItemCheckboxState, TreeItemCollapsibleState, TypeHierarchyItem, ViewColumn, WorkspaceEdit, DocumentDropEdit, DocumentPasteEdit, InlayHint, InlayHintLabelPart, InlayHintKind, RemoteAuthorityResolverError, ResolvedAuthority, ManagedResolvedAuthority, SourceControlInputBoxValidationType, ExtensionRuntime, TimelineItem, NotebookRange, NotebookCellKind, NotebookCellExecutionState, NotebookCellData, NotebookData, NotebookRendererScript, NotebookCellStatusBarAlignment, NotebookEditorRevealType, NotebookCellOutput, NotebookCellOutputItem, NotebookCellStatusBarItem, NotebookControllerAffinity, NotebookControllerAffinity2, NotebookEdit, NotebookKernelSourceAction, PortAttributes, LinkedEditingRanges, TestResultState, TestRunRequest, TestMessage, TestTag, TestRunProfileKind, DataTransfer, DataTransferItem, CoveredCount, FileCoverage, StatementCoverage, BranchCoverage, FunctionCoverage, WorkspaceTrustState, LanguageStatusSeverity, QuickPickItemKind, InputBoxValidationSeverity, TextTabInput, TextDiffTabInput, TextMergeTabInput, CustomEditorTabInput, NotebookEditorTabInput, NotebookDiffEditorTabInput, WebviewEditorTabInput, TerminalEditorTabInput, InteractiveWindowInput, InteractiveSessionVoteDirection, InteractiveSessionCopyKind, InteractiveEditorResponseFeedbackKind, StackFrameFocus, ThreadFocus,
|
|
40
|
+
import { Breakpoint, TerminalOutputAnchor, ChatMessage, ChatMessageRole, ChatVariableLevel, CallHierarchyIncomingCall, CallHierarchyItem, CallHierarchyOutgoingCall, CodeAction, CodeActionKind, CodeActionTriggerKind, CodeLens, Color, ColorInformation, ColorPresentation, ColorThemeKind, CommentMode, CommentState, CommentThreadCollapsibleState, CommentThreadState, CompletionItem, CompletionItemKind, CompletionItemTag, CompletionList, CompletionTriggerKind, ConfigurationTarget, CustomExecution, DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer, DebugConsoleMode, DecorationRangeBehavior, Diagnostic, DiagnosticRelatedInformation, DiagnosticSeverity, DiagnosticTag, Disposable, DocumentHighlight, DocumentHighlightKind, DocumentLink, DocumentSymbol, EndOfLine, EnvironmentVariableMutatorType, EvaluatableExpression, InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression, InlineCompletionTriggerKind, ExtensionKind, ExtensionMode, ExternalUriOpenerPriority, FileChangeType, FileDecoration, FileSystemError, FoldingRange, FoldingRangeKind, FunctionBreakpoint, InlineSuggestion, InlineSuggestionList, Hover, Location, MarkdownString, ParameterInformation, PortAutoForwardAction, Position, ProcessExecution, ProgressLocation, QuickInputButtons, Range, RelativePattern, Selection, SelectionRange, SemanticTokens, SemanticTokensBuilder, SemanticTokensEdit, SemanticTokensEdits, SemanticTokensLegend, ShellExecution, ShellQuoting, SignatureHelp, SignatureHelpTriggerKind, SignatureInformation, SnippetString, SourceBreakpoint, StandardTokenType, StatusBarAlignment, SymbolInformation, SymbolKind, SymbolTag, Task, TaskGroup, TaskPanelKind, TaskRevealKind, TaskScope, TerminalLink, TerminalQuickFixCommand, TerminalQuickFixOpener, TerminalLocation, TerminalProfile, TerminalExitReason, TextDocumentSaveReason, TextEdit, SnippetTextEdit, TextEditorLineNumbersStyle, TextEditorRevealType, TextEditorSelectionChangeKind, SyntaxTokenType, TextDocumentChangeReason, ThemeColor, ThemeIcon, TreeItem, TreeItemCheckboxState, TreeItemCollapsibleState, TypeHierarchyItem, ViewColumn, WorkspaceEdit, DocumentDropEdit, DocumentPasteEdit, InlayHint, InlayHintLabelPart, InlayHintKind, RemoteAuthorityResolverError, ResolvedAuthority, ManagedResolvedAuthority, SourceControlInputBoxValidationType, ExtensionRuntime, TimelineItem, NotebookRange, NotebookCellKind, NotebookCellExecutionState, NotebookCellData, NotebookData, NotebookRendererScript, NotebookCellStatusBarAlignment, NotebookEditorRevealType, NotebookCellOutput, NotebookCellOutputItem, NotebookCellStatusBarItem, NotebookControllerAffinity, NotebookControllerAffinity2, NotebookEdit, NotebookKernelSourceAction, PortAttributes, LinkedEditingRanges, TestResultState, TestRunRequest, TestMessage, TestTag, TestRunProfileKind, DataTransfer, DataTransferItem, CoveredCount, FileCoverage, StatementCoverage, BranchCoverage, FunctionCoverage, WorkspaceTrustState, LanguageStatusSeverity, QuickPickItemKind, InputBoxValidationSeverity, TextTabInput, TextDiffTabInput, TextMergeTabInput, CustomEditorTabInput, NotebookEditorTabInput, NotebookDiffEditorTabInput, WebviewEditorTabInput, TerminalEditorTabInput, InteractiveWindowInput, InteractiveSessionVoteDirection, InteractiveSessionCopyKind, InteractiveEditorResponseFeedbackKind, StackFrameFocus, ThreadFocus, RelatedInformationType } from './extHostTypes.js';
|
|
41
41
|
import { TelemetryTrustedValue } from '../../../platform/telemetry/common/telemetryUtils.js';
|
|
42
42
|
import { ExtHostUrls } from './extHostUrls.js';
|
|
43
43
|
import { ExtHostWebviews } from './extHostWebview.js';
|
|
@@ -99,6 +99,7 @@ import { ExtHostChatSlashCommands } from './extHostChatSlashCommand.js';
|
|
|
99
99
|
import { ExtHostChatVariables } from './extHostChatVariables.js';
|
|
100
100
|
import { ExtHostRelatedInformation } from './extHostAiRelatedInformation.js';
|
|
101
101
|
import { ExtHostAiEmbeddingVector } from './extHostEmbeddingVector.js';
|
|
102
|
+
import { ExtHostChatAgents } from './extHostChatAgents.js';
|
|
102
103
|
function createApiFactoryAndRegisterActors(accessor) {
|
|
103
104
|
const initData = accessor.get(IExtHostInitDataService);
|
|
104
105
|
const extHostFileSystemInfo = accessor.get(IExtHostFileSystemInfo);
|
|
@@ -217,6 +218,7 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
217
218
|
const extHostInteractiveEditor = rpcProtocol.set(ExtHostContext.ExtHostInlineChat, ( new ExtHostInteractiveEditor(rpcProtocol, extHostCommands, extHostDocuments, extHostLogService)));
|
|
218
219
|
const extHostChatProvider = rpcProtocol.set(ExtHostContext.ExtHostChatProvider, ( new ExtHostChatProvider(rpcProtocol, extHostLogService)));
|
|
219
220
|
const extHostChatSlashCommands = rpcProtocol.set(ExtHostContext.ExtHostChatSlashCommands, ( new ExtHostChatSlashCommands(rpcProtocol, extHostChatProvider, extHostLogService)));
|
|
221
|
+
const extHostChatAgents = rpcProtocol.set(ExtHostContext.ExtHostChatAgents, ( new ExtHostChatAgents(rpcProtocol, extHostChatProvider, extHostLogService)));
|
|
220
222
|
const extHostChatVariables = rpcProtocol.set(ExtHostContext.ExtHostChatVariables, ( new ExtHostChatVariables(rpcProtocol)));
|
|
221
223
|
const extHostChat = rpcProtocol.set(ExtHostContext.ExtHostChat, ( new ExtHostChat(rpcProtocol, extHostLogService)));
|
|
222
224
|
const extHostAiRelatedInformation = rpcProtocol.set(ExtHostContext.ExtHostAiRelatedInformation, ( new ExtHostRelatedInformation(rpcProtocol)));
|
|
@@ -329,7 +331,6 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
329
331
|
return extHostTerminalService.getDefaultShell(false);
|
|
330
332
|
},
|
|
331
333
|
get onDidChangeShell() {
|
|
332
|
-
checkProposedApiEnabled(extension, 'envShellEvent');
|
|
333
334
|
return extHostTerminalService.onDidChangeShell;
|
|
334
335
|
},
|
|
335
336
|
get isTelemetryEnabled() {
|
|
@@ -847,7 +848,7 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
847
848
|
return extHostWorkspace.getPath();
|
|
848
849
|
},
|
|
849
850
|
set rootPath(value) {
|
|
850
|
-
throw errors.
|
|
851
|
+
throw new errors.ReadonlyError('rootPath');
|
|
851
852
|
},
|
|
852
853
|
getWorkspaceFolder(resource) {
|
|
853
854
|
return extHostWorkspace.getWorkspaceFolder(resource);
|
|
@@ -859,13 +860,13 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
859
860
|
return extHostWorkspace.name;
|
|
860
861
|
},
|
|
861
862
|
set name(value) {
|
|
862
|
-
throw errors.
|
|
863
|
+
throw new errors.ReadonlyError('name');
|
|
863
864
|
},
|
|
864
865
|
get workspaceFile() {
|
|
865
866
|
return extHostWorkspace.workspaceFile;
|
|
866
867
|
},
|
|
867
868
|
set workspaceFile(value) {
|
|
868
|
-
throw errors.
|
|
869
|
+
throw new errors.ReadonlyError('workspaceFile');
|
|
869
870
|
},
|
|
870
871
|
updateWorkspaceFolders: (index, deleteCount, ...workspaceFoldersToAdd) => {
|
|
871
872
|
return extHostWorkspace.updateWorkspaceFolders(extension, index, deleteCount || 0, ...workspaceFoldersToAdd);
|
|
@@ -915,7 +916,7 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
915
916
|
return ( extHostDocuments.getAllDocumentData().map(data => data.document));
|
|
916
917
|
},
|
|
917
918
|
set textDocuments(value) {
|
|
918
|
-
throw errors.
|
|
919
|
+
throw new errors.ReadonlyError('textDocuments');
|
|
919
920
|
},
|
|
920
921
|
openTextDocument(uriOrFileNameOrOptions) {
|
|
921
922
|
let uriPromise;
|
|
@@ -1243,9 +1244,9 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
1243
1244
|
};
|
|
1244
1245
|
const interactive = {
|
|
1245
1246
|
_version: 1,
|
|
1246
|
-
registerInteractiveEditorSessionProvider(provider) {
|
|
1247
|
+
registerInteractiveEditorSessionProvider(provider, metadata) {
|
|
1247
1248
|
checkProposedApiEnabled(extension, 'interactive');
|
|
1248
|
-
return extHostInteractiveEditor.registerProvider(extension, provider);
|
|
1249
|
+
return extHostInteractiveEditor.registerProvider(extension, provider, metadata = { label: metadata?.label ?? extension.displayName ?? extension.name });
|
|
1249
1250
|
},
|
|
1250
1251
|
registerInteractiveSessionProvider(id, provider) {
|
|
1251
1252
|
checkProposedApiEnabled(extension, 'interactive');
|
|
@@ -1302,6 +1303,10 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
1302
1303
|
registerMappedEditsProvider(selector, provider) {
|
|
1303
1304
|
checkProposedApiEnabled(extension, 'mappedEditsProvider');
|
|
1304
1305
|
return extHostLanguageFeatures.registerMappedEditsProvider(extension, selector, provider);
|
|
1306
|
+
},
|
|
1307
|
+
registerAgent(name, agent, metadata) {
|
|
1308
|
+
checkProposedApiEnabled(extension, 'chatAgents');
|
|
1309
|
+
return extHostChatAgents.registerAgent(extension.identifier, name, agent, metadata);
|
|
1305
1310
|
}
|
|
1306
1311
|
};
|
|
1307
1312
|
return {
|
|
@@ -1441,6 +1446,7 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
1441
1446
|
TextEditorLineNumbersStyle: TextEditorLineNumbersStyle,
|
|
1442
1447
|
TextEditorRevealType: TextEditorRevealType,
|
|
1443
1448
|
TextEditorSelectionChangeKind: TextEditorSelectionChangeKind,
|
|
1449
|
+
SyntaxTokenType: SyntaxTokenType,
|
|
1444
1450
|
TextDocumentChangeReason: TextDocumentChangeReason,
|
|
1445
1451
|
ThemeColor: ThemeColor,
|
|
1446
1452
|
ThemeIcon: ThemeIcon,
|
|
@@ -1515,7 +1521,6 @@ function createApiFactoryAndRegisterActors(accessor) {
|
|
|
1515
1521
|
InteractiveEditorResponseFeedbackKind: InteractiveEditorResponseFeedbackKind,
|
|
1516
1522
|
StackFrameFocus: StackFrameFocus,
|
|
1517
1523
|
ThreadFocus: ThreadFocus,
|
|
1518
|
-
NotebookCodeActionKind: NotebookCodeActionKind,
|
|
1519
1524
|
RelatedInformationType: RelatedInformationType
|
|
1520
1525
|
};
|
|
1521
1526
|
};
|
|
@@ -31,6 +31,7 @@ const MainContext = {
|
|
|
31
31
|
MainThreadBulkEdits: ( createProxyIdentifier('MainThreadBulkEdits')),
|
|
32
32
|
MainThreadChatProvider: ( createProxyIdentifier('MainThreadChatProvider')),
|
|
33
33
|
MainThreadChatSlashCommands: ( createProxyIdentifier('MainThreadChatSlashCommands')),
|
|
34
|
+
MainThreadChatAgents: ( createProxyIdentifier('MainThreadChatAgents')),
|
|
34
35
|
MainThreadChatVariables: ( createProxyIdentifier('MainThreadChatVariables')),
|
|
35
36
|
MainThreadClipboard: ( createProxyIdentifier('MainThreadClipboard')),
|
|
36
37
|
MainThreadCommands: ( createProxyIdentifier('MainThreadCommands')),
|
|
@@ -49,7 +50,6 @@ const MainContext = {
|
|
|
49
50
|
MainThreadErrors: ( createProxyIdentifier('MainThreadErrors')),
|
|
50
51
|
MainThreadTreeViews: ( createProxyIdentifier('MainThreadTreeViews')),
|
|
51
52
|
MainThreadDownloadService: ( createProxyIdentifier('MainThreadDownloadService')),
|
|
52
|
-
MainThreadKeytar: ( createProxyIdentifier('MainThreadKeytar')),
|
|
53
53
|
MainThreadLanguageFeatures: ( createProxyIdentifier('MainThreadLanguageFeatures')),
|
|
54
54
|
MainThreadLanguages: ( createProxyIdentifier('MainThreadLanguages')),
|
|
55
55
|
MainThreadLogger: ( createProxyIdentifier('MainThreadLogger')),
|
|
@@ -151,6 +151,7 @@ const ExtHostContext = {
|
|
|
151
151
|
ExtHostInlineChat: ( createProxyIdentifier('ExtHostInlineChatShape')),
|
|
152
152
|
ExtHostChat: ( createProxyIdentifier('ExtHostChat')),
|
|
153
153
|
ExtHostChatSlashCommands: ( createProxyIdentifier('ExtHostChatSlashCommands')),
|
|
154
|
+
ExtHostChatAgents: ( createProxyIdentifier('ExtHostChatAgents')),
|
|
154
155
|
ExtHostChatVariables: ( createProxyIdentifier('ExtHostChatVariables')),
|
|
155
156
|
ExtHostChatProvider: ( createProxyIdentifier('ExtHostChatProvider')),
|
|
156
157
|
ExtHostAiRelatedInformation: ( createProxyIdentifier('ExtHostAiRelatedInformation')),
|
|
@@ -6,7 +6,7 @@ import { decodeSemanticTokensDto } from 'monaco-editor/esm/vs/editor/common/serv
|
|
|
6
6
|
import { validateWhenClauses } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
7
7
|
import { matchesSomeScheme } from 'monaco-editor/esm/vs/platform/opener/common/opener.js';
|
|
8
8
|
import { ApiCommand, ApiCommandArgument, ApiCommandResult } from './extHostCommands.js';
|
|
9
|
-
import { Position as Position$1, Range, WorkspaceSymbol, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall, WorkspaceEdit, DocumentLink, SignatureHelp, Selection as Selection$1, Color, ColorPresentation, InlayHint, FoldingRange, InlineValue, ViewColumn, TextEditorOpenOptions, TypeHierarchyItem, MappedEditsContext, DefinitionLink, location, DocumentHighlight, SymbolKind, TextEdit, Hover, CompletionItem, NotebookExclusiveDocumentPattern } from './extHostTypeConverters.js';
|
|
9
|
+
import { Position as Position$1, Range, WorkspaceSymbol, CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall, WorkspaceEdit, DocumentLink, SignatureHelp, Selection as Selection$1, Color, ColorPresentation, InlayHint, FoldingRange, InlineValueContext, InlineValue, ViewColumn, TextEditorOpenOptions, TypeHierarchyItem, MappedEditsContext, DefinitionLink, location, DocumentHighlight, SymbolKind, TextEdit, Hover, CompletionItem, NotebookExclusiveDocumentPattern } from './extHostTypeConverters.js';
|
|
10
10
|
import { Position, SelectionRange, SemanticTokensLegend, SemanticTokens, CompletionList, Range as Range$1, Selection, ColorInformation, Color as Color$1, SymbolInformation, Location, CodeLens, CodeAction, CodeActionKind } from './extHostTypes.js';
|
|
11
11
|
const newCommands = [
|
|
12
12
|
(
|
|
@@ -502,7 +502,16 @@ const newCommands = [
|
|
|
502
502
|
'vscode.executeInlineValueProvider',
|
|
503
503
|
'_executeInlineValueProvider',
|
|
504
504
|
'Execute inline value provider',
|
|
505
|
-
[
|
|
505
|
+
[
|
|
506
|
+
ApiCommandArgument.Uri,
|
|
507
|
+
ApiCommandArgument.Range,
|
|
508
|
+
( new ApiCommandArgument(
|
|
509
|
+
'context',
|
|
510
|
+
'An InlineValueContext',
|
|
511
|
+
v => v && typeof v.frameId === 'number' && v.stoppedLocation instanceof Range$1,
|
|
512
|
+
v => InlineValueContext.from(v)
|
|
513
|
+
))
|
|
514
|
+
],
|
|
506
515
|
( new ApiCommandResult('A promise that resolves to an array of InlineValue objects', result => {
|
|
507
516
|
return ( result.map(InlineValue.to));
|
|
508
517
|
}))
|
|
@@ -5,7 +5,7 @@ import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
|
5
5
|
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
6
6
|
import { localize } from 'monaco-editor/esm/vs/nls.js';
|
|
7
7
|
import { MainContext } from './extHost.protocol.js';
|
|
8
|
-
import { ChatReplyFollowup, ChatFollowup, CompletionItemKind, ChatVariable, MarkdownString } from './extHostTypeConverters.js';
|
|
8
|
+
import { ChatReplyFollowup, ChatFollowup, CompletionItemKind, ChatVariable, MarkdownString, Range } from './extHostTypeConverters.js';
|
|
9
9
|
class ChatProviderWrapper {
|
|
10
10
|
static { this._pool = 0; }
|
|
11
11
|
constructor(extension, provider) {
|
|
@@ -183,6 +183,15 @@ class ExtHostChat {
|
|
|
183
183
|
content: typeof progress.content === 'string' ? progress.content : MarkdownString.from(progress.content)
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
|
+
else if ('documents' in progress) {
|
|
187
|
+
this._proxy.$acceptResponseProgress(handle, sessionId, {
|
|
188
|
+
documents: ( progress.documents.map(d => ({
|
|
189
|
+
uri: d.uri,
|
|
190
|
+
version: d.version,
|
|
191
|
+
ranges: ( d.ranges.map(r => Range.from(r)))
|
|
192
|
+
})))
|
|
193
|
+
});
|
|
194
|
+
}
|
|
186
195
|
else {
|
|
187
196
|
this._proxy.$acceptResponseProgress(handle, sessionId, progress);
|
|
188
197
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { raceCancellation, DeferredPromise } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
2
|
+
import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
4
|
+
import { MainContext } from './extHost.protocol.js';
|
|
5
|
+
import { ChatMessage, ChatFollowup } from './extHostTypeConverters.js';
|
|
6
|
+
import { ChatMessageRole } from './extHostTypes.js';
|
|
7
|
+
class ExtHostChatAgents {
|
|
8
|
+
static { this._idPool = 0; }
|
|
9
|
+
constructor(mainContext, _extHostChatProvider, _logService) {
|
|
10
|
+
this._extHostChatProvider = _extHostChatProvider;
|
|
11
|
+
this._logService = _logService;
|
|
12
|
+
this._agents = ( new Map());
|
|
13
|
+
this._proxy = ( mainContext.getProxy(MainContext.MainThreadChatAgents));
|
|
14
|
+
}
|
|
15
|
+
registerAgent(extension, name, agent, metadata) {
|
|
16
|
+
const handle = ExtHostChatAgents._idPool++;
|
|
17
|
+
this._agents.set(handle, { extension, agent });
|
|
18
|
+
this._proxy.$registerAgent(handle, name, metadata);
|
|
19
|
+
return toDisposable(() => {
|
|
20
|
+
this._proxy.$unregisterAgent(handle);
|
|
21
|
+
this._agents.delete(handle);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async $invokeAgent(handle, requestId, prompt, context, token) {
|
|
25
|
+
const data = this._agents.get(handle);
|
|
26
|
+
if (!data) {
|
|
27
|
+
this._logService.warn(`[CHAT](${handle}) CANNOT invoke agent because the agent is not registered`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let done = false;
|
|
31
|
+
function throwIfDone() {
|
|
32
|
+
if (done) {
|
|
33
|
+
throw new Error('Only valid while executing the command');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const commandExecution = ( new DeferredPromise());
|
|
37
|
+
token.onCancellationRequested(() => commandExecution.complete());
|
|
38
|
+
setTimeout(() => commandExecution.complete(), 3 * 1000);
|
|
39
|
+
this._extHostChatProvider.allowListExtensionWhile(data.extension, commandExecution.p);
|
|
40
|
+
const task = data.agent({ role: ChatMessageRole.User, content: prompt }, { history: ( context.history.map(ChatMessage.to)) }, ( new Progress(p => {
|
|
41
|
+
throwIfDone();
|
|
42
|
+
this._proxy.$handleProgressChunk(requestId, { content: isInteractiveProgressFileTree(p.message) ? p.message : p.message.value });
|
|
43
|
+
})), token);
|
|
44
|
+
try {
|
|
45
|
+
return await raceCancellation(Promise.resolve(task).then((v) => {
|
|
46
|
+
if (v && 'followUp' in v) {
|
|
47
|
+
const convertedFollowup = v?.followUp?.map(f => ChatFollowup.from(f));
|
|
48
|
+
return { followUp: convertedFollowup };
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}), token);
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
done = true;
|
|
55
|
+
commandExecution.complete();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function isInteractiveProgressFileTree(thing) {
|
|
60
|
+
return !!thing && typeof thing === 'object' && 'treeData' in thing;
|
|
61
|
+
}
|
|
62
|
+
export { ExtHostChatAgents };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
2
|
import { MainContext } from './extHost.protocol.js';
|
|
3
3
|
import { ChatMessageRole } from './extHostTypes.js';
|
|
4
|
-
import { ChatMessage } from './extHostTypeConverters.js';
|
|
4
|
+
import { ChatMessage, ChatFollowup } from './extHostTypeConverters.js';
|
|
5
5
|
import { Progress } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
6
6
|
import { raceCancellation, DeferredPromise } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
7
|
class ExtHostChatSlashCommands {
|
|
@@ -35,14 +35,20 @@ class ExtHostChatSlashCommands {
|
|
|
35
35
|
}
|
|
36
36
|
const commandExecution = ( new DeferredPromise());
|
|
37
37
|
token.onCancellationRequested(() => commandExecution.complete());
|
|
38
|
-
setTimeout(() => commandExecution.complete(),
|
|
38
|
+
setTimeout(() => commandExecution.complete(), 10 * 1000);
|
|
39
39
|
this._extHostChatProvider.allowListExtensionWhile(data.extension, commandExecution.p);
|
|
40
40
|
const task = data.command({ role: ChatMessageRole.User, content: prompt }, { history: ( context.history.map(ChatMessage.to)) }, ( new Progress(p => {
|
|
41
41
|
throwIfDone();
|
|
42
|
-
this._proxy.$handleProgressChunk(requestId, { content: p.message.value });
|
|
42
|
+
this._proxy.$handleProgressChunk(requestId, { content: isInteractiveProgressFileTree(p.message) ? p.message : p.message.value });
|
|
43
43
|
})), token);
|
|
44
44
|
try {
|
|
45
|
-
await raceCancellation(Promise.resolve(task)
|
|
45
|
+
return await raceCancellation(Promise.resolve(task).then((v) => {
|
|
46
|
+
if (v && 'followUp' in v) {
|
|
47
|
+
const convertedFollowup = v?.followUp?.map(f => ChatFollowup.from(f));
|
|
48
|
+
return { followUp: convertedFollowup };
|
|
49
|
+
}
|
|
50
|
+
return undefined;
|
|
51
|
+
}), token);
|
|
46
52
|
}
|
|
47
53
|
finally {
|
|
48
54
|
done = true;
|
|
@@ -50,4 +56,7 @@ class ExtHostChatSlashCommands {
|
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
}
|
|
59
|
+
function isInteractiveProgressFileTree(thing) {
|
|
60
|
+
return !!thing && typeof thing === 'object' && 'treeData' in thing;
|
|
61
|
+
}
|
|
53
62
|
export { ExtHostChatSlashCommands };
|
|
@@ -72,7 +72,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
72
72
|
const registration = this.registerCommand(false, apiCommand.id, async (...apiArgs) => {
|
|
73
73
|
const internalArgs = ( (apiCommand.args.map((arg, i) => {
|
|
74
74
|
if (!arg.validate(apiArgs[i])) {
|
|
75
|
-
throw new Error(`Invalid argument '${arg.name}' when running '${apiCommand.id}', received: ${apiArgs[i]}`);
|
|
75
|
+
throw new Error(`Invalid argument '${arg.name}' when running '${apiCommand.id}', received: ${typeof apiArgs[i] === 'object' ? JSON.stringify(apiArgs[i], null, '\t') : apiArgs[i]} `);
|
|
76
76
|
}
|
|
77
77
|
return arg.convert(apiArgs[i]);
|
|
78
78
|
})));
|
|
@@ -175,7 +175,7 @@ let ExtHostCommands = class ExtHostCommands {
|
|
|
175
175
|
validateConstraint(args[i], description.args[i].constraint);
|
|
176
176
|
}
|
|
177
177
|
catch (err) {
|
|
178
|
-
throw new Error(`Running the contributed command: '${id}' failed.
|
|
178
|
+
throw new Error(`Running the contributed command: '${id}' failed.Illegal argument '${description.args[i].name}' - ${description.args[i].description} `);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -264,7 +264,7 @@ class CommandsConverter {
|
|
|
264
264
|
this._commands = _commands;
|
|
265
265
|
this._lookupApiCommand = _lookupApiCommand;
|
|
266
266
|
this._logService = _logService;
|
|
267
|
-
this.delegatingCommandId = `__vsc${( ( Date.now().toString(36)))}`;
|
|
267
|
+
this.delegatingCommandId = `__vsc${( ( Date.now().toString(36)))} `;
|
|
268
268
|
this._cache = ( (new Map()));
|
|
269
269
|
this._cachIdPool = 0;
|
|
270
270
|
this._commands.registerCommand(true, this.delegatingCommandId, this._executeConvertedCommand, this);
|
|
@@ -288,7 +288,7 @@ class CommandsConverter {
|
|
|
288
288
|
result.arguments = ( (apiCommand.args.map((arg, i) => arg.convert(command.arguments && command.arguments[i]))));
|
|
289
289
|
}
|
|
290
290
|
else if (isNonEmptyArray(command.arguments)) {
|
|
291
|
-
const id = `${command.command}/${++this._cachIdPool}`;
|
|
291
|
+
const id = `${command.command} /${++this._cachIdPool}`;
|
|
292
292
|
this._cache.set(id, command);
|
|
293
293
|
disposables.add(toDisposable(() => {
|
|
294
294
|
this._cache.delete(id);
|
|
@@ -415,7 +415,7 @@ function createExtHostComments(mainContext, commands, documents) {
|
|
|
415
415
|
this._id = _id;
|
|
416
416
|
this._label = _label;
|
|
417
417
|
this._threads = ( new Map());
|
|
418
|
-
proxy.$registerCommentController(this.handle, _id, _label);
|
|
418
|
+
proxy.$registerCommentController(this.handle, _id, _label, this._extension.identifier.value);
|
|
419
419
|
const that = this;
|
|
420
420
|
this.value = ( Object.freeze({
|
|
421
421
|
id: that.id,
|
|
@@ -35,7 +35,7 @@ import { ExtensionSecrets } from './extHostSecrets.js';
|
|
|
35
35
|
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
36
36
|
import { IExtHostLocalizationService } from './extHostLocalizationService.js';
|
|
37
37
|
import { StopWatch } from 'monaco-editor/esm/vs/base/common/stopwatch.js';
|
|
38
|
-
import { isWebWorker, setTimeout0 } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
38
|
+
import { isCI, isWebWorker, setTimeout0 } from 'monaco-editor/esm/vs/base/common/platform.js';
|
|
39
39
|
import { IExtHostManagedSockets } from './extHostManagedSockets.js';
|
|
40
40
|
var AbstractExtHostExtensionService_1;
|
|
41
41
|
const IHostUtils = ( createDecorator('IHostUtils'));
|
|
@@ -62,13 +62,17 @@ let AbstractExtHostExtensionService = AbstractExtHostExtensionService_1 = class
|
|
|
62
62
|
this._readyToStartExtensionHost = ( new Barrier());
|
|
63
63
|
this._readyToRunExtensions = ( new Barrier());
|
|
64
64
|
this._eagerExtensionsActivated = ( new Barrier());
|
|
65
|
-
this._activationEventsReader = ( new SyncedActivationEventsReader(this._initData.activationEvents));
|
|
66
|
-
this._globalRegistry = ( new ExtensionDescriptionRegistry(this._activationEventsReader, this._initData.allExtensions));
|
|
67
|
-
const myExtensionsSet = ( new ExtensionIdentifierSet(this._initData.myExtensions));
|
|
65
|
+
this._activationEventsReader = ( new SyncedActivationEventsReader(this._initData.extensions.activationEvents));
|
|
66
|
+
this._globalRegistry = ( new ExtensionDescriptionRegistry(this._activationEventsReader, this._initData.extensions.allExtensions));
|
|
67
|
+
const myExtensionsSet = ( new ExtensionIdentifierSet(this._initData.extensions.myExtensions));
|
|
68
68
|
this._myRegistry = ( new ExtensionDescriptionRegistry(
|
|
69
69
|
this._activationEventsReader,
|
|
70
70
|
filterExtensions(this._globalRegistry, myExtensionsSet)
|
|
71
71
|
));
|
|
72
|
+
if (isCI) {
|
|
73
|
+
this._logService.info(`Creating extension host with the following global extensions: ${printExtIds(this._globalRegistry)}`);
|
|
74
|
+
this._logService.info(`Creating extension host with the following local extensions: ${printExtIds(this._myRegistry)}`);
|
|
75
|
+
}
|
|
72
76
|
this._storage = ( new ExtHostStorage(this._extHostContext, this._logService));
|
|
73
77
|
this._secretState = ( new ExtHostSecretState(this._extHostContext));
|
|
74
78
|
this._storagePath = storagePath;
|
|
@@ -528,9 +532,20 @@ let AbstractExtHostExtensionService = AbstractExtHostExtensionService_1 = class
|
|
|
528
532
|
return ( new Promise((resolve, reject) => {
|
|
529
533
|
const oldTestRunnerCallback = (error, failures) => {
|
|
530
534
|
if (error) {
|
|
535
|
+
if (isCI) {
|
|
536
|
+
this._logService.error(`Test runner called back with error`, error);
|
|
537
|
+
}
|
|
531
538
|
reject(error);
|
|
532
539
|
}
|
|
533
540
|
else {
|
|
541
|
+
if (isCI) {
|
|
542
|
+
if (failures) {
|
|
543
|
+
this._logService.info(`Test runner called back with ${failures} failures.`);
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
this._logService.info(`Test runner called back with successful outcome.`);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
534
549
|
resolve((typeof failures === 'number' && failures > 0) ? 1 : 0 );
|
|
535
550
|
}
|
|
536
551
|
};
|
|
@@ -539,9 +554,15 @@ let AbstractExtHostExtensionService = AbstractExtHostExtensionService_1 = class
|
|
|
539
554
|
if (runResult && runResult.then) {
|
|
540
555
|
runResult
|
|
541
556
|
.then(() => {
|
|
557
|
+
if (isCI) {
|
|
558
|
+
this._logService.info(`Test runner finished successfully.`);
|
|
559
|
+
}
|
|
542
560
|
resolve(0);
|
|
543
561
|
})
|
|
544
562
|
.catch((err) => {
|
|
563
|
+
if (isCI) {
|
|
564
|
+
this._logService.error(`Test runner finished with error`, err);
|
|
565
|
+
}
|
|
545
566
|
reject(err instanceof Error && err.stack ? err.stack : String(err));
|
|
546
567
|
});
|
|
547
568
|
}
|
|
@@ -715,6 +736,10 @@ let AbstractExtHostExtensionService = AbstractExtHostExtensionService_1 = class
|
|
|
715
736
|
const { globalRegistry, myExtensions } = applyExtensionsDelta(this._activationEventsReader, this._globalRegistry, this._myRegistry, extensionsDelta);
|
|
716
737
|
this._globalRegistry.set(globalRegistry.getAllExtensionDescriptions());
|
|
717
738
|
this._myRegistry.set(myExtensions);
|
|
739
|
+
if (isCI) {
|
|
740
|
+
this._logService.info(`$startExtensionHost: global extensions: ${printExtIds(this._globalRegistry)}`);
|
|
741
|
+
this._logService.info(`$startExtensionHost: local extensions: ${printExtIds(this._myRegistry)}`);
|
|
742
|
+
}
|
|
718
743
|
return this._startExtensionHost();
|
|
719
744
|
}
|
|
720
745
|
$activateByEvent(activationEvent, activationKind) {
|
|
@@ -741,6 +766,10 @@ let AbstractExtHostExtensionService = AbstractExtHostExtensionService_1 = class
|
|
|
741
766
|
extensionsPaths.setSearchTree(newSearchTree);
|
|
742
767
|
this._globalRegistry.set(globalRegistry.getAllExtensionDescriptions());
|
|
743
768
|
this._myRegistry.set(myExtensions);
|
|
769
|
+
if (isCI) {
|
|
770
|
+
this._logService.info(`$deltaExtensions: global extensions: ${printExtIds(this._globalRegistry)}`);
|
|
771
|
+
this._logService.info(`$deltaExtensions: local extensions: ${printExtIds(this._myRegistry)}`);
|
|
772
|
+
}
|
|
744
773
|
return Promise.resolve(undefined);
|
|
745
774
|
}
|
|
746
775
|
async $test_latency(n) {
|
|
@@ -803,6 +832,9 @@ function getTelemetryActivationEvent(extensionDescription, reason) {
|
|
|
803
832
|
};
|
|
804
833
|
return event;
|
|
805
834
|
}
|
|
835
|
+
function printExtIds(registry) {
|
|
836
|
+
return ( registry.getAllExtensionDescriptions().map(ext => ext.identifier.value)).join(',');
|
|
837
|
+
}
|
|
806
838
|
const IExtHostExtensionService = ( createDecorator('IExtHostExtensionService'));
|
|
807
839
|
class Extension {
|
|
808
840
|
#extensionService;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
2
2
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
3
3
|
import { MainContext } from './extHost.protocol.js';
|
|
4
|
-
import { Range, Selection, Position, MarkdownString, WorkspaceEdit as WorkspaceEdit$1, TextEdit } from './extHostTypeConverters.js';
|
|
5
|
-
import { WorkspaceEdit
|
|
4
|
+
import { Range, Selection, Position, MarkdownString, WorkspaceEdit as WorkspaceEdit$1, TextEdit, InteractiveEditorResponseFeedbackKind } from './extHostTypeConverters.js';
|
|
5
|
+
import { WorkspaceEdit } from './extHostTypes.js';
|
|
6
6
|
import { ApiCommand, ApiCommandArgument, ApiCommandResult } from './extHostCommands.js';
|
|
7
7
|
class ProviderWrapper {
|
|
8
8
|
static { this._pool = 0; }
|
|
@@ -45,10 +45,10 @@ class ExtHostInteractiveEditor {
|
|
|
45
45
|
ApiCommandResult.Void
|
|
46
46
|
)));
|
|
47
47
|
}
|
|
48
|
-
registerProvider(extension, provider) {
|
|
48
|
+
registerProvider(extension, provider, metadata) {
|
|
49
49
|
const wrapper = ( new ProviderWrapper(extension, provider));
|
|
50
50
|
this._inputProvider.set(wrapper.handle, wrapper);
|
|
51
|
-
this._proxy.$registerInteractiveEditorProvider(wrapper.handle,
|
|
51
|
+
this._proxy.$registerInteractiveEditorProvider(wrapper.handle, metadata.label, extension.identifier.value, typeof provider.handleInteractiveEditorResponseFeedback === 'function');
|
|
52
52
|
return toDisposable(() => {
|
|
53
53
|
this._proxy.$unregisterInteractiveEditorProvider(wrapper.handle);
|
|
54
54
|
this._inputProvider.delete(wrapper.handle);
|
|
@@ -89,7 +89,6 @@ class ExtHostInteractiveEditor {
|
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
const apiRequest = {
|
|
92
|
-
session: sessionData.session,
|
|
93
92
|
prompt: request.prompt,
|
|
94
93
|
selection: Selection.to(request.selection),
|
|
95
94
|
wholeRange: Range.to(request.wholeRange),
|
|
@@ -114,9 +113,7 @@ class ExtHostInteractiveEditor {
|
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
115
|
};
|
|
117
|
-
const task =
|
|
118
|
-
? entry.provider.provideInteractiveEditorResponse2(apiRequest, progress, token)
|
|
119
|
-
: entry.provider.provideInteractiveEditorResponse(apiRequest, token);
|
|
116
|
+
const task = entry.provider.provideInteractiveEditorResponse(sessionData.session, apiRequest, progress, token);
|
|
120
117
|
Promise.resolve(task).finally(() => done = true);
|
|
121
118
|
const res = await task;
|
|
122
119
|
if (res) {
|
|
@@ -158,31 +155,11 @@ class ExtHostInteractiveEditor {
|
|
|
158
155
|
const sessionData = this._inputSessions.get(sessionId);
|
|
159
156
|
const response = sessionData?.responses[responseId];
|
|
160
157
|
if (entry && response) {
|
|
161
|
-
|
|
162
|
-
switch (kind) {
|
|
163
|
-
case 1 :
|
|
164
|
-
apiKind = InteractiveEditorResponseFeedbackKind.Helpful;
|
|
165
|
-
break;
|
|
166
|
-
case 0 :
|
|
167
|
-
apiKind = InteractiveEditorResponseFeedbackKind.Unhelpful;
|
|
168
|
-
break;
|
|
169
|
-
case 2 :
|
|
170
|
-
apiKind = InteractiveEditorResponseFeedbackKind.Undone;
|
|
171
|
-
break;
|
|
172
|
-
case 3 :
|
|
173
|
-
apiKind = InteractiveEditorResponseFeedbackKind.Accepted;
|
|
174
|
-
break;
|
|
175
|
-
}
|
|
158
|
+
const apiKind = InteractiveEditorResponseFeedbackKind.to(kind);
|
|
176
159
|
entry.provider.handleInteractiveEditorResponseFeedback?.(sessionData.session, response, apiKind);
|
|
177
160
|
}
|
|
178
161
|
}
|
|
179
162
|
$releaseSession(handle, sessionId) {
|
|
180
|
-
const sessionData = this._inputSessions.get(sessionId);
|
|
181
|
-
const entry = this._inputProvider.get(handle);
|
|
182
|
-
if (sessionData && entry) {
|
|
183
|
-
entry.provider.releaseInteractiveEditorSession?.(sessionData.session);
|
|
184
|
-
}
|
|
185
|
-
this._inputSessions.delete(sessionId);
|
|
186
163
|
}
|
|
187
164
|
static _isMessageResponse(thing) {
|
|
188
165
|
return typeof thing === 'object' && typeof thing.contents === 'object';
|