@codingame/monaco-vscode-extensions-service-override 29.1.1 → 30.0.1
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/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +11 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +100 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +1 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +135 -104
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +1 -0
- package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/browserView/common/browserEditorInput.js +13 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.0.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - extensions service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "30.0.1",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "30.0.1"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -18,7 +18,9 @@ import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/
|
|
|
18
18
|
import { IExtHostContext } from "../../services/extensions/common/extHostCustomers.js";
|
|
19
19
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
20
20
|
import { Dto } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier";
|
|
21
|
-
import { IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainThreadChatAgentsShape2 } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
21
|
+
import { IChatSessionCustomizationProviderMetadataDto, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainThreadChatAgentsShape2 } from "@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol";
|
|
22
|
+
import { ICustomizationHarnessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service";
|
|
23
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
22
24
|
export declare class MainThreadChatTask implements IChatTask {
|
|
23
25
|
content: IMarkdownString;
|
|
24
26
|
readonly kind = "progressTask";
|
|
@@ -45,6 +47,8 @@ export declare class MainThreadChatAgents2 extends Disposable implements MainThr
|
|
|
45
47
|
private readonly _uriIdentityService;
|
|
46
48
|
private readonly _promptsService;
|
|
47
49
|
private readonly _languageModelToolsService;
|
|
50
|
+
private readonly _customizationHarnessService;
|
|
51
|
+
private readonly _configurationService;
|
|
48
52
|
private readonly _agents;
|
|
49
53
|
private readonly _agentCompletionProviders;
|
|
50
54
|
private readonly _agentIdsToCompletionProviders;
|
|
@@ -52,11 +56,13 @@ export declare class MainThreadChatAgents2 extends Disposable implements MainThr
|
|
|
52
56
|
private readonly _promptFileProviders;
|
|
53
57
|
private readonly _promptFileProviderEmitters;
|
|
54
58
|
private readonly _promptFileContentRegistrations;
|
|
59
|
+
private readonly _customizationProviders;
|
|
60
|
+
private readonly _customizationProviderEmitters;
|
|
55
61
|
private readonly _pendingProgress;
|
|
56
62
|
private readonly _proxy;
|
|
57
63
|
private readonly _activeTasks;
|
|
58
64
|
private readonly _unresolvedAnchors;
|
|
59
|
-
constructor(extHostContext: IExtHostContext, _chatAgentService: IChatAgentService, _chatSessionService: IChatSessionsService, _chatService: IChatService, _languageFeaturesService: ILanguageFeaturesService, _chatWidgetService: IChatWidgetService, _instantiationService: IInstantiationService, _logService: ILogService, _extensionService: IExtensionService, _uriIdentityService: IUriIdentityService, _promptsService: IPromptsService, _languageModelToolsService: ILanguageModelToolsService);
|
|
65
|
+
constructor(extHostContext: IExtHostContext, _chatAgentService: IChatAgentService, _chatSessionService: IChatSessionsService, _chatService: IChatService, _languageFeaturesService: ILanguageFeaturesService, _chatWidgetService: IChatWidgetService, _instantiationService: IInstantiationService, _logService: ILogService, _extensionService: IExtensionService, _uriIdentityService: IUriIdentityService, _promptsService: IPromptsService, _languageModelToolsService: ILanguageModelToolsService, _customizationHarnessService: ICustomizationHarnessService, _configurationService: IConfigurationService);
|
|
60
66
|
private _acceptActiveChatSession;
|
|
61
67
|
private _pushCustomAgents;
|
|
62
68
|
private _pushInstructions;
|
|
@@ -77,4 +83,7 @@ export declare class MainThreadChatAgents2 extends Disposable implements MainThr
|
|
|
77
83
|
$registerPromptFileProvider(handle: number, type: string, extensionId: ExtensionIdentifier): Promise<void>;
|
|
78
84
|
$unregisterPromptFileProvider(handle: number): void;
|
|
79
85
|
$onDidChangePromptFiles(handle: number): void;
|
|
86
|
+
$registerChatSessionCustomizationProvider(handle: number, chatSessionType: string, metadata: IChatSessionCustomizationProviderMetadataDto, extensionId: ExtensionIdentifier): Promise<void>;
|
|
87
|
+
$unregisterChatSessionCustomizationProvider(handle: number): void;
|
|
88
|
+
$onDidChangeCustomizations(handle: number): void;
|
|
80
89
|
}
|
|
@@ -9,6 +9,7 @@ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/netw
|
|
|
9
9
|
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
10
10
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
11
11
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
12
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
12
13
|
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
13
14
|
import { getWordAtText } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/wordHelper';
|
|
14
15
|
import { CompletionItemKind } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
@@ -19,6 +20,7 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
19
20
|
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
20
21
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
21
22
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
23
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
22
24
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
23
25
|
import { isValidPromptType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
24
26
|
import { ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
@@ -34,6 +36,9 @@ import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
34
36
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
35
37
|
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
36
38
|
import { isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
39
|
+
import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
|
|
40
|
+
import { AICustomizationManagementSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
|
|
41
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
37
42
|
import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
|
|
38
43
|
import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
39
44
|
|
|
@@ -82,7 +87,9 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
82
87
|
_extensionService,
|
|
83
88
|
_uriIdentityService,
|
|
84
89
|
_promptsService,
|
|
85
|
-
_languageModelToolsService
|
|
90
|
+
_languageModelToolsService,
|
|
91
|
+
_customizationHarnessService,
|
|
92
|
+
_configurationService
|
|
86
93
|
) {
|
|
87
94
|
super();
|
|
88
95
|
this._chatAgentService = _chatAgentService;
|
|
@@ -96,6 +103,8 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
96
103
|
this._uriIdentityService = _uriIdentityService;
|
|
97
104
|
this._promptsService = _promptsService;
|
|
98
105
|
this._languageModelToolsService = _languageModelToolsService;
|
|
106
|
+
this._customizationHarnessService = _customizationHarnessService;
|
|
107
|
+
this._configurationService = _configurationService;
|
|
99
108
|
this._agents = this._register(( new DisposableMap()));
|
|
100
109
|
this._agentCompletionProviders = this._register(( new DisposableMap()));
|
|
101
110
|
this._agentIdsToCompletionProviders = this._register(( new DisposableMap()));
|
|
@@ -103,12 +112,22 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
103
112
|
this._promptFileProviders = this._register(( new DisposableMap()));
|
|
104
113
|
this._promptFileProviderEmitters = this._register(( new DisposableMap()));
|
|
105
114
|
this._promptFileContentRegistrations = this._register(( new DisposableMap()));
|
|
115
|
+
this._customizationProviders = this._register(( new DisposableMap()));
|
|
116
|
+
this._customizationProviderEmitters = this._register(( new DisposableMap()));
|
|
106
117
|
this._pendingProgress = ( new Map());
|
|
107
118
|
this._activeTasks = ( new Map());
|
|
108
119
|
this._unresolvedAnchors = ( new Map());
|
|
109
120
|
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
|
|
121
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
122
|
+
if (e.affectsConfiguration("chat.customizations.providerApi.enabled")) {
|
|
123
|
+
if (!this._configurationService.getValue("chat.customizations.providerApi.enabled")) {
|
|
124
|
+
this._customizationProviders.clearAndDisposeAll();
|
|
125
|
+
this._customizationProviderEmitters.clearAndDisposeAll();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
110
129
|
this._register(this._chatService.onDidDisposeSession(e => {
|
|
111
|
-
for (const resource of e.
|
|
130
|
+
for (const resource of e.sessionResources) {
|
|
112
131
|
this._proxy.$releaseSession(resource);
|
|
113
132
|
}
|
|
114
133
|
}));
|
|
@@ -547,8 +566,86 @@ let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
|
547
566
|
emitter.fire();
|
|
548
567
|
}
|
|
549
568
|
}
|
|
569
|
+
async $registerChatSessionCustomizationProvider(handle, chatSessionType, metadata, extensionId) {
|
|
570
|
+
if (!this._configurationService.getValue("chat.customizations.providerApi.enabled")) {
|
|
571
|
+
this._logService.trace(
|
|
572
|
+
`[MainThreadChatAgents2] Customization provider API is disabled, ignoring registration from ${extensionId.value}`
|
|
573
|
+
);
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const extension = await this._extensionService.getExtension(extensionId.value);
|
|
577
|
+
if (!extension) {
|
|
578
|
+
this._logService.error(
|
|
579
|
+
`[MainThreadChatAgents2] Could not find extension for customization provider: ${extensionId.value}`
|
|
580
|
+
);
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
const emitter = ( new Emitter());
|
|
584
|
+
this._customizationProviderEmitters.set(handle, emitter);
|
|
585
|
+
const itemProvider = {
|
|
586
|
+
onDidChange: emitter.event,
|
|
587
|
+
provideChatSessionCustomizations: async token => {
|
|
588
|
+
const items = await this._proxy.$provideChatSessionCustomizations(handle, token);
|
|
589
|
+
if (!items) {
|
|
590
|
+
return undefined;
|
|
591
|
+
}
|
|
592
|
+
return ( items.map(item => ({
|
|
593
|
+
uri: URI.revive(item.uri),
|
|
594
|
+
type: item.type,
|
|
595
|
+
name: item.name,
|
|
596
|
+
description: item.description,
|
|
597
|
+
groupKey: item.groupKey,
|
|
598
|
+
badge: item.badge,
|
|
599
|
+
badgeTooltip: item.badgeTooltip
|
|
600
|
+
})));
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
const hiddenSections = metadata.unsupportedTypes?.map(type => {
|
|
604
|
+
switch (type) {
|
|
605
|
+
case "agent":
|
|
606
|
+
return AICustomizationManagementSection.Agents;
|
|
607
|
+
case "skill":
|
|
608
|
+
return AICustomizationManagementSection.Skills;
|
|
609
|
+
case "instructions":
|
|
610
|
+
return AICustomizationManagementSection.Instructions;
|
|
611
|
+
case "prompt":
|
|
612
|
+
return AICustomizationManagementSection.Prompts;
|
|
613
|
+
case "hook":
|
|
614
|
+
return AICustomizationManagementSection.Hooks;
|
|
615
|
+
default:
|
|
616
|
+
return type;
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
const descriptor = {
|
|
620
|
+
id: chatSessionType,
|
|
621
|
+
label: metadata.label,
|
|
622
|
+
icon: metadata.iconId ? ThemeIcon.fromId(metadata.iconId) : ThemeIcon.fromId(Codicon.extensions.id),
|
|
623
|
+
hiddenSections,
|
|
624
|
+
getStorageSourceFilter: () => ({
|
|
625
|
+
sources: [
|
|
626
|
+
PromptsStorage.local,
|
|
627
|
+
PromptsStorage.user,
|
|
628
|
+
PromptsStorage.plugin,
|
|
629
|
+
PromptsStorage.extension
|
|
630
|
+
]
|
|
631
|
+
}),
|
|
632
|
+
itemProvider
|
|
633
|
+
};
|
|
634
|
+
const registration = this._customizationHarnessService.registerExternalHarness(descriptor);
|
|
635
|
+
this._customizationProviders.set(handle, registration);
|
|
636
|
+
}
|
|
637
|
+
$unregisterChatSessionCustomizationProvider(handle) {
|
|
638
|
+
this._customizationProviders.deleteAndDispose(handle);
|
|
639
|
+
this._customizationProviderEmitters.deleteAndDispose(handle);
|
|
640
|
+
}
|
|
641
|
+
$onDidChangeCustomizations(handle) {
|
|
642
|
+
const emitter = this._customizationProviderEmitters.get(handle);
|
|
643
|
+
if (emitter) {
|
|
644
|
+
emitter.fire();
|
|
645
|
+
}
|
|
646
|
+
}
|
|
550
647
|
};
|
|
551
|
-
MainThreadChatAgents2 = __decorate([extHostNamedCustomer(MainContext.MainThreadChatAgents2), ( __param(1, IChatAgentService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, ILanguageFeaturesService)), ( __param(5, IChatWidgetService)), ( __param(6, IInstantiationService)), ( __param(7, ILogService)), ( __param(8, IExtensionService)), ( __param(9, IUriIdentityService)), ( __param(10, IPromptsService)), ( __param(11, ILanguageModelToolsService))], MainThreadChatAgents2);
|
|
648
|
+
MainThreadChatAgents2 = __decorate([extHostNamedCustomer(MainContext.MainThreadChatAgents2), ( __param(1, IChatAgentService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, ILanguageFeaturesService)), ( __param(5, IChatWidgetService)), ( __param(6, IInstantiationService)), ( __param(7, ILogService)), ( __param(8, IExtensionService)), ( __param(9, IUriIdentityService)), ( __param(10, IPromptsService)), ( __param(11, ILanguageModelToolsService)), ( __param(12, ICustomizationHarnessService)), ( __param(13, IConfigurationService))], MainThreadChatAgents2);
|
|
552
649
|
function computeCompletionRanges(model, position, reg) {
|
|
553
650
|
const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
|
|
554
651
|
if (!varWord && model.getWordUntilPosition(position).word) {
|
|
@@ -7,12 +7,12 @@ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
7
7
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
8
8
|
import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service";
|
|
9
9
|
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
10
|
+
import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service";
|
|
10
11
|
import { IChatContentInlineReference, IChatProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
11
12
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
12
13
|
import { IChatSession, IChatSessionHistoryItem, IChatSessionItem, IChatSessionProviderOptionItem, IChatSessionRequestHistoryItem, ReadonlyChatSessionOptionsMap } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
|
|
13
14
|
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
14
15
|
import { IChatAgentRequest } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents";
|
|
15
|
-
import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service";
|
|
16
16
|
import { IChatArtifactsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service";
|
|
17
17
|
import { IChatTodoListService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatTodoListService.service";
|
|
18
18
|
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
@@ -86,7 +86,6 @@ export declare class MainThreadChatSessions extends Disposable implements MainTh
|
|
|
86
86
|
private _getHandleForSessionType;
|
|
87
87
|
$registerChatSessionItemController(handle: number, chatSessionType: string): void;
|
|
88
88
|
private getController;
|
|
89
|
-
private _resolveSessionItem;
|
|
90
89
|
$updateChatSessionItems(controllerHandle: number, change: IChatSessionItemsChange): Promise<void>;
|
|
91
90
|
$addOrUpdateChatSessionItem(controllerHandle: number, item: Dto<IChatSessionItem>): Promise<void>;
|
|
92
91
|
$onDidChangeChatSessionOptions(handle: number, sessionResourceComponents: UriComponents, updates: Record<string, string | IChatSessionProviderOptionItem>): void;
|
|
@@ -95,7 +94,6 @@ export declare class MainThreadChatSessions extends Disposable implements MainTh
|
|
|
95
94
|
* Re-sends pending and in-flight requests from the original session on the committed session.
|
|
96
95
|
*/
|
|
97
96
|
private _resendPendingRequests;
|
|
98
|
-
private handleSessionModelOverrides;
|
|
99
97
|
private _provideChatSessionContent;
|
|
100
98
|
$unregisterChatSessionItemController(handle: number): void;
|
|
101
99
|
$registerChatSessionContentProvider(handle: number, chatSessionScheme: string): void;
|
|
@@ -109,7 +107,6 @@ export declare class MainThreadChatSessions extends Disposable implements MainTh
|
|
|
109
107
|
$onDidChangeChatSessionProviderOptions(handle: number): void;
|
|
110
108
|
private _refreshProviderOptions;
|
|
111
109
|
dispose(): void;
|
|
112
|
-
private _reviveTooltip;
|
|
113
110
|
/**
|
|
114
111
|
* Notify the extension about option changes for a session
|
|
115
112
|
*/
|
|
@@ -3,10 +3,11 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
4
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
5
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
|
-
import { Disposable, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { markdownStringEqual, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
|
+
import { Disposable, DisposableResourceMap, DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
8
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
9
|
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
10
|
+
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
10
11
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
11
12
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
13
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -18,15 +19,15 @@ import { hasValidDiff } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
18
19
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
19
20
|
import { isIChatViewViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
20
21
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
22
|
+
import { getInProgressSessionDescription } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription';
|
|
23
|
+
import { getSessionStatusForModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution';
|
|
21
24
|
import { ChatEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput';
|
|
22
|
-
import {
|
|
23
|
-
import { ResponseModelState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
25
|
+
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
24
26
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
25
|
-
import { ChatSessionOptionsMap
|
|
27
|
+
import { ChatSessionOptionsMap } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
26
28
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
27
29
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
28
|
-
import { isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
29
|
-
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
30
|
+
import { getChatSessionType, isUntitledChatSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
30
31
|
import { IChatArtifactsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service';
|
|
31
32
|
import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatTodoListService.service';
|
|
32
33
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
@@ -35,7 +36,20 @@ import { extHostNamedCustomer } from '../../services/extensions/common/extHostCu
|
|
|
35
36
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
36
37
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
37
38
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
39
|
+
import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignalFromEvent';
|
|
38
40
|
|
|
41
|
+
function stringOrMarkdownEqual(a, b) {
|
|
42
|
+
if (a === b) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (!a || !b) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (typeof a === "string" || typeof b === "string") {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return markdownStringEqual(a, b);
|
|
52
|
+
}
|
|
39
53
|
class ObservableChatSession extends Disposable {
|
|
40
54
|
get options() {
|
|
41
55
|
return this._options ? ( new Map(this._options)) : undefined;
|
|
@@ -97,7 +111,8 @@ class ObservableChatSession extends Disposable {
|
|
|
97
111
|
variables
|
|
98
112
|
} : undefined,
|
|
99
113
|
id: turn.id,
|
|
100
|
-
modelId: turn.modelId
|
|
114
|
+
modelId: turn.modelId,
|
|
115
|
+
modeInstructions: turn.modeInstructions ? revive(turn.modeInstructions) : undefined
|
|
101
116
|
};
|
|
102
117
|
}
|
|
103
118
|
return {
|
|
@@ -250,7 +265,8 @@ class ObservableChatSession extends Disposable {
|
|
|
250
265
|
participant: request.participant,
|
|
251
266
|
command: request.command,
|
|
252
267
|
variableData: undefined,
|
|
253
|
-
modelId: request.modelId
|
|
268
|
+
modelId: request.modelId,
|
|
269
|
+
modeInstructions: request.modeInstructions
|
|
254
270
|
};
|
|
255
271
|
}
|
|
256
272
|
dispose() {
|
|
@@ -266,24 +282,49 @@ class ObservableChatSession extends Disposable {
|
|
|
266
282
|
}
|
|
267
283
|
}
|
|
268
284
|
let MainThreadChatSessionItemController = class MainThreadChatSessionItemController extends Disposable {
|
|
269
|
-
constructor(proxy, chatSessionType, handle,
|
|
285
|
+
constructor(proxy, chatSessionType, handle, _chatService, _logService) {
|
|
270
286
|
super();
|
|
287
|
+
this._chatService = _chatService;
|
|
271
288
|
this._logService = _logService;
|
|
272
289
|
this._onDidChangeChatSessionItems = this._register(( new Emitter()));
|
|
273
290
|
this.onDidChangeChatSessionItems = this._onDidChangeChatSessionItems.event;
|
|
291
|
+
this._modelListeners = this._register(( new DisposableResourceMap()));
|
|
292
|
+
this._isDisposed = false;
|
|
274
293
|
this._items = ( new ResourceMap());
|
|
275
294
|
this._proxy = proxy;
|
|
276
295
|
this._handle = handle;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
296
|
+
const addModelListeners = async model => {
|
|
297
|
+
if (getChatSessionType(model.sessionResource) !== chatSessionType) {
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
await this.refresh(CancellationToken.None);
|
|
301
|
+
if (this._isDisposed) {
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
this.tryUpdateItemForModel(model);
|
|
305
|
+
const requestChangeListener = ( model.lastRequestObs.map(
|
|
306
|
+
last => last?.response && observableSignalFromEvent("chatSessions.modelRequestChangeListener", last.response.onDidChange)
|
|
307
|
+
));
|
|
308
|
+
const modelChangeListener = observableSignalFromEvent("chatSessions.modelChangeListener", model.onDidChange);
|
|
309
|
+
this._modelListeners.set(model.sessionResource, autorun(reader => {
|
|
310
|
+
requestChangeListener.read(reader)?.read(reader);
|
|
311
|
+
modelChangeListener.read(reader);
|
|
312
|
+
this.tryUpdateItemForModel(model);
|
|
313
|
+
}));
|
|
314
|
+
};
|
|
315
|
+
this._register(_chatService.onDidCreateModel(model => addModelListeners(model)));
|
|
316
|
+
for (const model of _chatService.chatModels.get()) {
|
|
317
|
+
addModelListeners(model);
|
|
318
|
+
}
|
|
319
|
+
this._register(_chatService.onDidDisposeSession(e => {
|
|
320
|
+
for (const sessionResource of e.sessionResources) {
|
|
321
|
+
this._modelListeners.deleteAndDispose(sessionResource);
|
|
322
|
+
}
|
|
323
|
+
}));
|
|
324
|
+
}
|
|
325
|
+
dispose() {
|
|
326
|
+
this._isDisposed = true;
|
|
327
|
+
super.dispose();
|
|
287
328
|
}
|
|
288
329
|
get items() {
|
|
289
330
|
return Array.from(( this._items.values()));
|
|
@@ -300,39 +341,77 @@ let MainThreadChatSessionItemController = class MainThreadChatSessionItemControl
|
|
|
300
341
|
if (!dto) {
|
|
301
342
|
return undefined;
|
|
302
343
|
}
|
|
303
|
-
const item =
|
|
304
|
-
...dto,
|
|
305
|
-
resource: URI.revive(dto.resource),
|
|
306
|
-
changes: revive(dto.changes)
|
|
307
|
-
};
|
|
308
|
-
this._items.set(item.resource, item);
|
|
309
|
-
this._onDidChangeChatSessionItems.fire({
|
|
310
|
-
addedOrUpdated: [item]
|
|
311
|
-
});
|
|
344
|
+
const item = this.addOrUpdateItem(dto);
|
|
312
345
|
return item;
|
|
313
346
|
}
|
|
314
|
-
acceptChange(change) {
|
|
347
|
+
async acceptChange(change) {
|
|
348
|
+
const addedOrUpdatedItems = [];
|
|
315
349
|
for (const item of change.addedOrUpdated) {
|
|
316
|
-
|
|
317
|
-
this._items.set(item.resource, item);
|
|
350
|
+
addedOrUpdatedItems.push(await this.addOrUpdateItem(item));
|
|
318
351
|
}
|
|
319
352
|
for (const uri of change.removed) {
|
|
320
353
|
this._items.delete(uri);
|
|
321
354
|
}
|
|
322
355
|
this._onDidChangeChatSessionItems.fire({
|
|
323
|
-
addedOrUpdated:
|
|
356
|
+
addedOrUpdated: addedOrUpdatedItems,
|
|
324
357
|
removed: change.removed
|
|
325
358
|
});
|
|
326
359
|
}
|
|
327
|
-
addOrUpdateItem(
|
|
328
|
-
|
|
329
|
-
|
|
360
|
+
async addOrUpdateItem(dto) {
|
|
361
|
+
const resource = URI.revive(dto.resource);
|
|
362
|
+
warnOnUntitledSessionResource(resource, this._logService);
|
|
363
|
+
const existing = this._items.get(resource);
|
|
364
|
+
const updated = ( new MainThreadChatSessionItem(
|
|
365
|
+
dto,
|
|
366
|
+
this._chatService.getSession(resource),
|
|
367
|
+
await this._chatService.getMetadataForSession(resource)
|
|
368
|
+
));
|
|
369
|
+
if (existing?.isEqual(updated)) {
|
|
370
|
+
return existing;
|
|
371
|
+
}
|
|
372
|
+
this._items.set(resource, updated);
|
|
330
373
|
this._onDidChangeChatSessionItems.fire({
|
|
331
|
-
addedOrUpdated: [
|
|
374
|
+
addedOrUpdated: [updated]
|
|
332
375
|
});
|
|
376
|
+
return updated;
|
|
377
|
+
}
|
|
378
|
+
async tryUpdateItemForModel(model) {
|
|
379
|
+
const resource = model.sessionResource;
|
|
380
|
+
const existing = this._items.get(resource);
|
|
381
|
+
if (existing) {
|
|
382
|
+
this.addOrUpdateItem(existing);
|
|
383
|
+
}
|
|
333
384
|
}
|
|
334
385
|
};
|
|
335
386
|
MainThreadChatSessionItemController = ( __decorate([( __param(3, IChatService)), ( __param(4, ILogService))], MainThreadChatSessionItemController));
|
|
387
|
+
class MainThreadChatSessionItem {
|
|
388
|
+
constructor(dto, model, detailOverrides) {
|
|
389
|
+
this.resource = URI.revive(dto.resource);
|
|
390
|
+
this.label = dto.label;
|
|
391
|
+
this.timing = dto.timing;
|
|
392
|
+
this.iconPath = dto.iconPath;
|
|
393
|
+
this.badge = reviveMarkdownString(dto.badge);
|
|
394
|
+
this.tooltip = reviveMarkdownString(dto.tooltip);
|
|
395
|
+
this.archived = dto.archived;
|
|
396
|
+
this.metadata = dto.metadata;
|
|
397
|
+
this.description = (model && getInProgressSessionDescription(model)) ?? reviveMarkdownString(dto.description);
|
|
398
|
+
this.status = (model && getSessionStatusForModel(model)) ?? dto.status;
|
|
399
|
+
this.changes = revive(dto.changes);
|
|
400
|
+
if (detailOverrides && !this.changes) {
|
|
401
|
+
const diffs = {
|
|
402
|
+
files: detailOverrides.stats?.fileCount || 0,
|
|
403
|
+
insertions: detailOverrides.stats?.added || 0,
|
|
404
|
+
deletions: detailOverrides.stats?.removed || 0
|
|
405
|
+
};
|
|
406
|
+
if (hasValidDiff(diffs)) {
|
|
407
|
+
this.changes = diffs;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
isEqual(other) {
|
|
412
|
+
return isEqual(this.resource, other.resource) && this.label === other.label && this.description === other.description && this.status === other.status && this.timing.created === other.timing.created && this.timing.lastRequestStarted === other.timing.lastRequestStarted && this.timing.lastRequestEnded === other.timing.lastRequestEnded && equals(this.changes, other.changes) && equals(this.iconPath, other.iconPath) && stringOrMarkdownEqual(this.badge, other.badge) && stringOrMarkdownEqual(this.tooltip, other.tooltip) && this.archived === other.archived && equals(this.metadata, other.metadata);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
336
415
|
let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
337
416
|
constructor(
|
|
338
417
|
_extHostContext,
|
|
@@ -425,45 +504,19 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
425
504
|
}
|
|
426
505
|
return registration.controller;
|
|
427
506
|
}
|
|
428
|
-
async _resolveSessionItem(item) {
|
|
429
|
-
const uri = URI.revive(item.resource);
|
|
430
|
-
const model = this._chatService.getSession(uri);
|
|
431
|
-
if (model) {
|
|
432
|
-
item = await this.handleSessionModelOverrides(model, item);
|
|
433
|
-
}
|
|
434
|
-
let changes = revive(item.changes);
|
|
435
|
-
if (!changes || !model) {
|
|
436
|
-
const stats = (await this._chatService.getMetadataForSession(uri))?.stats;
|
|
437
|
-
const diffs = {
|
|
438
|
-
files: stats?.fileCount || 0,
|
|
439
|
-
insertions: stats?.added || 0,
|
|
440
|
-
deletions: stats?.removed || 0
|
|
441
|
-
};
|
|
442
|
-
if (hasValidDiff(diffs)) {
|
|
443
|
-
changes = diffs;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
return {
|
|
447
|
-
...item,
|
|
448
|
-
changes,
|
|
449
|
-
resource: uri,
|
|
450
|
-
iconPath: item.iconPath,
|
|
451
|
-
tooltip: item.tooltip ? this._reviveTooltip(item.tooltip) : undefined,
|
|
452
|
-
archived: item.archived
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
507
|
async $updateChatSessionItems(controllerHandle, change) {
|
|
456
508
|
const controller = this.getController(controllerHandle);
|
|
457
|
-
const resolvedItems = await Promise.all(( change.addedOrUpdated.map(item => this._resolveSessionItem(item))));
|
|
458
509
|
controller.acceptChange({
|
|
459
|
-
addedOrUpdated:
|
|
510
|
+
addedOrUpdated: change.addedOrUpdated,
|
|
460
511
|
removed: ( change.removed.map(uri => URI.revive(uri)))
|
|
461
512
|
});
|
|
462
513
|
}
|
|
463
514
|
async $addOrUpdateChatSessionItem(controllerHandle, item) {
|
|
464
515
|
const controller = this.getController(controllerHandle);
|
|
465
|
-
|
|
466
|
-
|
|
516
|
+
controller.acceptChange({
|
|
517
|
+
addedOrUpdated: [item],
|
|
518
|
+
removed: []
|
|
519
|
+
});
|
|
467
520
|
}
|
|
468
521
|
$onDidChangeChatSessionOptions(handle, sessionResourceComponents, updates) {
|
|
469
522
|
const sessionResource = URI.revive(sessionResourceComponents);
|
|
@@ -486,7 +539,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
486
539
|
const contribution = this._chatSessionsService.getAllChatSessionContributions().find(c => c.type === chatSessionType);
|
|
487
540
|
try {
|
|
488
541
|
this._chatTodoListService.migrateTodos(originalResource, modifiedResource);
|
|
489
|
-
this._chatArtifactsService.
|
|
542
|
+
this._chatArtifactsService.getArtifacts(originalResource).migrate(this._chatArtifactsService.getArtifacts(modifiedResource));
|
|
490
543
|
if (chatSessionType === "copilotcli") {
|
|
491
544
|
this._chatDebugService.invokeProviders(modifiedResource).catch(() => {});
|
|
492
545
|
}
|
|
@@ -529,6 +582,7 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
529
582
|
ref?.dispose();
|
|
530
583
|
}
|
|
531
584
|
this._resendPendingRequests(originalResource, modifiedResource);
|
|
585
|
+
this._chatSessionsService.fireSessionCommitted(originalResource, modifiedResource);
|
|
532
586
|
} finally {
|
|
533
587
|
originalModel?.dispose();
|
|
534
588
|
}
|
|
@@ -536,29 +590,6 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
536
590
|
_resendPendingRequests(originalResource, modifiedResource) {
|
|
537
591
|
this._chatService.migrateRequests(originalResource, modifiedResource);
|
|
538
592
|
}
|
|
539
|
-
async handleSessionModelOverrides(model, session) {
|
|
540
|
-
const outgoingSession = {
|
|
541
|
-
...session
|
|
542
|
-
};
|
|
543
|
-
const inProgress = model.getRequests().filter(r => r.response && !r.response.isComplete);
|
|
544
|
-
if (inProgress.length) {
|
|
545
|
-
outgoingSession.description = this._chatSessionsService.getInProgressSessionDescription(model);
|
|
546
|
-
}
|
|
547
|
-
if (!(outgoingSession.changes instanceof Array)) {
|
|
548
|
-
const modelStats = await awaitStatsForSession(model);
|
|
549
|
-
if (modelStats) {
|
|
550
|
-
outgoingSession.changes = {
|
|
551
|
-
files: modelStats.fileCount,
|
|
552
|
-
insertions: modelStats.added,
|
|
553
|
-
deletions: modelStats.removed
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
if (model.lastRequest?.response?.state === ResponseModelState.NeedsInput) {
|
|
558
|
-
outgoingSession.status = ChatSessionStatus.NeedsInput;
|
|
559
|
-
}
|
|
560
|
-
return outgoingSession;
|
|
561
|
-
}
|
|
562
593
|
async _provideChatSessionContent(providerHandle, sessionResource, token) {
|
|
563
594
|
warnOnUntitledSessionResource(sessionResource, this._logService);
|
|
564
595
|
let session = this._activeSessions.get(sessionResource);
|
|
@@ -709,18 +740,6 @@ let MainThreadChatSessions = class MainThreadChatSessions extends Disposable {
|
|
|
709
740
|
this._sessionDisposables.clear();
|
|
710
741
|
super.dispose();
|
|
711
742
|
}
|
|
712
|
-
_reviveTooltip(tooltip) {
|
|
713
|
-
if (!tooltip) {
|
|
714
|
-
return undefined;
|
|
715
|
-
}
|
|
716
|
-
if (typeof tooltip === "string") {
|
|
717
|
-
return tooltip;
|
|
718
|
-
}
|
|
719
|
-
if (typeof tooltip === "object" && "value" in tooltip) {
|
|
720
|
-
return MarkdownString.lift(tooltip);
|
|
721
|
-
}
|
|
722
|
-
return undefined;
|
|
723
|
-
}
|
|
724
743
|
async notifyOptionsChange(handle, sessionResource, updates) {
|
|
725
744
|
this._logService.trace(
|
|
726
745
|
`[MainThreadChatSessions] notifyOptionsChange: starting proxy call for handle ${handle}, sessionResource ${sessionResource}`
|
|
@@ -751,5 +770,17 @@ function warnOnUntitledSessionResource(resource, logService) {
|
|
|
751
770
|
);
|
|
752
771
|
}
|
|
753
772
|
}
|
|
773
|
+
function reviveMarkdownString(value) {
|
|
774
|
+
if (!value) {
|
|
775
|
+
return undefined;
|
|
776
|
+
}
|
|
777
|
+
if (typeof value === "string") {
|
|
778
|
+
return value;
|
|
779
|
+
}
|
|
780
|
+
if (typeof value === "object" && "value" in value) {
|
|
781
|
+
return MarkdownString.lift(value);
|
|
782
|
+
}
|
|
783
|
+
return undefined;
|
|
784
|
+
}
|
|
754
785
|
|
|
755
786
|
export { MainThreadChatSessions, ObservableChatSession };
|
|
@@ -34,6 +34,7 @@ let MainThreadLanguageModelTools = class MainThreadLanguageModelTools extends Di
|
|
|
34
34
|
displayName: tool.displayName,
|
|
35
35
|
toolReferenceName: tool.toolReferenceName,
|
|
36
36
|
legacyToolReferenceFullNames: tool.legacyToolReferenceFullNames,
|
|
37
|
+
fullReferenceName: tool.source.type === "mcp" ? this._languageModelToolsService.getFullReferenceName(tool) : undefined,
|
|
37
38
|
tags: tool.tags,
|
|
38
39
|
userDescription: tool.userDescription,
|
|
39
40
|
modelDescription: tool.modelDescription,
|
|
@@ -24,7 +24,7 @@ export declare class BrowserEditorInput extends EditorInput {
|
|
|
24
24
|
static readonly EDITOR_ID = "workbench.editor.browser";
|
|
25
25
|
private static readonly DEFAULT_LABEL;
|
|
26
26
|
private readonly _id;
|
|
27
|
-
private
|
|
27
|
+
private _initialData;
|
|
28
28
|
private _model;
|
|
29
29
|
private _modelPromise;
|
|
30
30
|
constructor(options: IBrowserEditorInputData, themeService: IThemeService, browserViewWorkbenchService: IBrowserViewWorkbenchService, lifecycleService: ILifecycleService, instantiationService: IInstantiationService, telemetryService: ITelemetryService);
|
|
@@ -32,6 +32,7 @@ export declare class BrowserEditorInput extends EditorInput {
|
|
|
32
32
|
get url(): string | undefined;
|
|
33
33
|
get title(): string | undefined;
|
|
34
34
|
get favicon(): string | undefined;
|
|
35
|
+
navigate(url: string): void;
|
|
35
36
|
resolve(): Promise<IBrowserViewModel>;
|
|
36
37
|
get typeId(): string;
|
|
37
38
|
get editorId(): string;
|
|
@@ -39,7 +39,7 @@ let BrowserEditorInput = class BrowserEditorInput extends EditorInput {
|
|
|
39
39
|
this.EDITOR_ID = "workbench.editor.browser";
|
|
40
40
|
}
|
|
41
41
|
static {
|
|
42
|
-
this.DEFAULT_LABEL = ( localize(
|
|
42
|
+
this.DEFAULT_LABEL = ( localize(4617, "Browser"));
|
|
43
43
|
}
|
|
44
44
|
constructor(
|
|
45
45
|
options,
|
|
@@ -80,6 +80,17 @@ let BrowserEditorInput = class BrowserEditorInput extends EditorInput {
|
|
|
80
80
|
get favicon() {
|
|
81
81
|
return this._model ? this._model.favicon : this._initialData.favicon;
|
|
82
82
|
}
|
|
83
|
+
navigate(url) {
|
|
84
|
+
if (this._model) {
|
|
85
|
+
void this._model.loadURL(url);
|
|
86
|
+
} else {
|
|
87
|
+
this._initialData = {
|
|
88
|
+
id: this._id,
|
|
89
|
+
url
|
|
90
|
+
};
|
|
91
|
+
this._onDidChangeLabel.fire();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
83
94
|
async resolve() {
|
|
84
95
|
if (!this._model && !this._modelPromise) {
|
|
85
96
|
this._modelPromise = (async () => {
|
|
@@ -195,7 +206,7 @@ let BrowserEditorInput = class BrowserEditorInput extends EditorInput {
|
|
|
195
206
|
return {
|
|
196
207
|
resource: this.resource,
|
|
197
208
|
options: {
|
|
198
|
-
override: BrowserEditorInput_1.
|
|
209
|
+
override: BrowserEditorInput_1.EDITOR_ID,
|
|
199
210
|
viewState
|
|
200
211
|
}
|
|
201
212
|
};
|
|
@@ -60,7 +60,7 @@ let CustomTextEditorModel = CustomTextEditorModel_1 = class CustomTextEditorMode
|
|
|
60
60
|
}));
|
|
61
61
|
this._register(extensionService.onWillStop(e => {
|
|
62
62
|
e.veto(true, ( localize(
|
|
63
|
-
|
|
63
|
+
8014,
|
|
64
64
|
"An extension provided text editor for '{0}' is still open that would close otherwise.",
|
|
65
65
|
this.name
|
|
66
66
|
)));
|
|
@@ -169,11 +169,11 @@ let ExtensionBisectUi = class ExtensionBisectUi {
|
|
|
169
169
|
}
|
|
170
170
|
_showBisectPrompt() {
|
|
171
171
|
const goodPrompt = {
|
|
172
|
-
label: ( localize(
|
|
172
|
+
label: ( localize(15979, "I can't reproduce")),
|
|
173
173
|
run: () => this._commandService.executeCommand("extension.bisect.next", false)
|
|
174
174
|
};
|
|
175
175
|
const badPrompt = {
|
|
176
|
-
label: ( localize(
|
|
176
|
+
label: ( localize(15980, "I can reproduce")),
|
|
177
177
|
run: () => this._commandService.executeCommand("extension.bisect.next", true)
|
|
178
178
|
};
|
|
179
179
|
const stop = {
|
|
@@ -181,10 +181,10 @@ let ExtensionBisectUi = class ExtensionBisectUi {
|
|
|
181
181
|
run: () => this._commandService.executeCommand("extension.bisect.stop")
|
|
182
182
|
};
|
|
183
183
|
const message = this._extensionBisectService.disabledCount === 1 ? ( localize(
|
|
184
|
-
|
|
184
|
+
15981,
|
|
185
185
|
"Extension Bisect is active and has disabled 1 extension. Check if you can still reproduce the problem and proceed by selecting from these options."
|
|
186
186
|
)) : ( localize(
|
|
187
|
-
|
|
187
|
+
15982,
|
|
188
188
|
"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",
|
|
189
189
|
this._extensionBisectService.disabledCount
|
|
190
190
|
));
|
|
@@ -200,7 +200,7 @@ registerAction2(class extends Action2 {
|
|
|
200
200
|
constructor() {
|
|
201
201
|
super({
|
|
202
202
|
id: "extension.bisect.start",
|
|
203
|
-
title: ( localize2(
|
|
203
|
+
title: ( localize2(15983, "Start Extension Bisect")),
|
|
204
204
|
category: Categories.Help,
|
|
205
205
|
f1: true,
|
|
206
206
|
precondition: ( ExtensionBisectUi.ctxIsBisectActive.negate()),
|
|
@@ -220,13 +220,13 @@ registerAction2(class extends Action2 {
|
|
|
220
220
|
const extensionsBisect = accessor.get(IExtensionBisectService);
|
|
221
221
|
const extensions = (await extensionManagement.getInstalled(ExtensionType.User)).filter(ext => extensionEnablementService.isEnabled(ext));
|
|
222
222
|
const res = await dialogService.confirm({
|
|
223
|
-
message: ( localize(
|
|
223
|
+
message: ( localize(15984, "Extension Bisect")),
|
|
224
224
|
detail: ( localize(
|
|
225
|
-
|
|
225
|
+
15985,
|
|
226
226
|
"Extension Bisect will use binary search to find an extension that causes a problem. During the process the window reloads repeatedly (~{0} times). Each time you must confirm if you are still seeing problems.",
|
|
227
227
|
2 + Math.log2(extensions.length) | 0
|
|
228
228
|
)),
|
|
229
|
-
primaryButton: ( localize(
|
|
229
|
+
primaryButton: ( localize(15986, "&&Start Extension Bisect"))
|
|
230
230
|
});
|
|
231
231
|
if (res.confirmed) {
|
|
232
232
|
await extensionsBisect.start(extensions);
|
|
@@ -238,7 +238,7 @@ registerAction2(class extends Action2 {
|
|
|
238
238
|
constructor() {
|
|
239
239
|
super({
|
|
240
240
|
id: "extension.bisect.next",
|
|
241
|
-
title: ( localize2(
|
|
241
|
+
title: ( localize2(15987, "Continue Extension Bisect")),
|
|
242
242
|
category: Categories.Help,
|
|
243
243
|
f1: true,
|
|
244
244
|
precondition: ExtensionBisectUi.ctxIsBisectActive
|
|
@@ -272,24 +272,24 @@ registerAction2(class extends Action2 {
|
|
|
272
272
|
return;
|
|
273
273
|
}
|
|
274
274
|
if (done.bad) {
|
|
275
|
-
await dialogService.info(( localize(
|
|
276
|
-
|
|
275
|
+
await dialogService.info(( localize(15988, "Extension Bisect")), ( localize(
|
|
276
|
+
15989,
|
|
277
277
|
"Extension Bisect is done but no extension has been identified. This might be a problem with {0}.",
|
|
278
278
|
productService.nameShort
|
|
279
279
|
)));
|
|
280
280
|
} else {
|
|
281
281
|
const res = await dialogService.confirm({
|
|
282
282
|
type: Severity.Info,
|
|
283
|
-
message: ( localize(
|
|
284
|
-
primaryButton: ( localize(
|
|
285
|
-
cancelButton: ( localize(
|
|
283
|
+
message: ( localize(15988, "Extension Bisect")),
|
|
284
|
+
primaryButton: ( localize(15990, "&&Report Issue & Continue")),
|
|
285
|
+
cancelButton: ( localize(15991, "Continue")),
|
|
286
286
|
detail: ( localize(
|
|
287
|
-
|
|
287
|
+
15992,
|
|
288
288
|
"Extension Bisect is done and has identified {0} as the extension causing the problem.",
|
|
289
289
|
done.id
|
|
290
290
|
)),
|
|
291
291
|
checkbox: {
|
|
292
|
-
label: ( localize(
|
|
292
|
+
label: ( localize(15993, "Keep this extension disabled")),
|
|
293
293
|
checked: true
|
|
294
294
|
}
|
|
295
295
|
});
|
|
@@ -310,24 +310,24 @@ registerAction2(class extends Action2 {
|
|
|
310
310
|
result
|
|
311
311
|
} = await dialogService.prompt({
|
|
312
312
|
type: Severity.Info,
|
|
313
|
-
message: ( localize(
|
|
313
|
+
message: ( localize(15994, "Extension Bisect")),
|
|
314
314
|
detail: ( localize(
|
|
315
|
-
|
|
315
|
+
15995,
|
|
316
316
|
"Extension Bisect is active and has disabled {0} extensions. Check if you can still reproduce the problem and proceed by selecting from these options.",
|
|
317
317
|
bisectService.disabledCount
|
|
318
318
|
)),
|
|
319
319
|
buttons: [{
|
|
320
|
-
label: ( localize(
|
|
320
|
+
label: ( localize(15996, "I ca&&n't reproduce")),
|
|
321
321
|
run: () => false
|
|
322
322
|
}, {
|
|
323
|
-
label: ( localize(
|
|
323
|
+
label: ( localize(15997, "I can &&reproduce")),
|
|
324
324
|
run: () => true
|
|
325
325
|
}, {
|
|
326
|
-
label: ( localize(
|
|
326
|
+
label: ( localize(15998, "&&Stop Bisect")),
|
|
327
327
|
run: () => undefined
|
|
328
328
|
}],
|
|
329
329
|
cancelButton: {
|
|
330
|
-
label: ( localize(
|
|
330
|
+
label: ( localize(15999, "&&Cancel Bisect")),
|
|
331
331
|
run: () => null
|
|
332
332
|
}
|
|
333
333
|
});
|
|
@@ -338,7 +338,7 @@ registerAction2(class extends Action2 {
|
|
|
338
338
|
constructor() {
|
|
339
339
|
super({
|
|
340
340
|
id: "extension.bisect.stop",
|
|
341
|
-
title: ( localize2(
|
|
341
|
+
title: ( localize2(16000, "Stop Extension Bisect")),
|
|
342
342
|
category: Categories.Help,
|
|
343
343
|
f1: true,
|
|
344
344
|
precondition: ExtensionBisectUi.ctxIsBisectActive
|
package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js
CHANGED
|
@@ -768,7 +768,7 @@ let WebExtensionsScannerService = class WebExtensionsScannerService extends Disp
|
|
|
768
768
|
}
|
|
769
769
|
if (!this.extensionManifestPropertiesService.canExecuteOnWeb(manifest)) {
|
|
770
770
|
throw ( new Error(( localize(
|
|
771
|
-
|
|
771
|
+
16015,
|
|
772
772
|
"Cannot add '{0}' because this extension is not a web extension.",
|
|
773
773
|
manifest.displayName || manifest.name
|
|
774
774
|
))));
|
|
@@ -1049,7 +1049,7 @@ if (isWeb) {
|
|
|
1049
1049
|
constructor() {
|
|
1050
1050
|
super({
|
|
1051
1051
|
id: "workbench.extensions.action.openInstalledWebExtensionsResource",
|
|
1052
|
-
title: ( localize2(
|
|
1052
|
+
title: ( localize2(16016, "Open Installed Web Extensions Resource")),
|
|
1053
1053
|
category: Categories.Developer,
|
|
1054
1054
|
f1: true,
|
|
1055
1055
|
precondition: IsWebContext
|
|
@@ -221,13 +221,13 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
221
221
|
}
|
|
222
222
|
}, {
|
|
223
223
|
id: "join.disconnectRemote",
|
|
224
|
-
label: ( localize(
|
|
224
|
+
label: ( localize(16082, "Disconnect Remote Agent")),
|
|
225
225
|
order: WillShutdownJoinerOrder.Last
|
|
226
226
|
});
|
|
227
227
|
} else {
|
|
228
228
|
event.join(this._doStopExtensionHosts(), {
|
|
229
229
|
id: "join.stopExtensionHosts",
|
|
230
|
-
label: ( localize(
|
|
230
|
+
label: ( localize(16083, "Stopping Extension Hosts"))
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
}));
|
|
@@ -300,7 +300,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
300
300
|
this._notificationService.notify({
|
|
301
301
|
severity: Severity.Error,
|
|
302
302
|
message: ( localize(
|
|
303
|
-
|
|
303
|
+
16084,
|
|
304
304
|
"The following extensions contain dependency loops and have been disabled: {0}",
|
|
305
305
|
( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(", ")
|
|
306
306
|
))
|
|
@@ -537,7 +537,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
537
537
|
this._notificationService.notify({
|
|
538
538
|
severity: Severity.Error,
|
|
539
539
|
message: ( localize(
|
|
540
|
-
|
|
540
|
+
16084,
|
|
541
541
|
"The following extensions contain dependency loops and have been disabled: {0}",
|
|
542
542
|
( result.removedDueToLooping.map(e => `'${e.identifier.value}'`)).join(", ")
|
|
543
543
|
))
|
|
@@ -552,7 +552,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
552
552
|
const extensionHostManager = this.findTestExtensionHost(this._environmentService.extensionTestsLocationURI);
|
|
553
553
|
if (!extensionHostManager) {
|
|
554
554
|
const msg = ( localize(
|
|
555
|
-
|
|
555
|
+
16085,
|
|
556
556
|
"No extension host found that can launch the test runner at {0}.",
|
|
557
557
|
(this._environmentService.extensionTestsLocationURI.toString())
|
|
558
558
|
));
|
|
@@ -722,7 +722,7 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
722
722
|
vetoReasons.add(reason);
|
|
723
723
|
}
|
|
724
724
|
}).catch(error => {
|
|
725
|
-
vetoReasons.add(( localize(
|
|
725
|
+
vetoReasons.add(( localize(16086, "{0} (Error: {1})", reason, toErrorMessage(error))));
|
|
726
726
|
});
|
|
727
727
|
}
|
|
728
728
|
}
|
|
@@ -740,9 +740,9 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
740
740
|
confirmed
|
|
741
741
|
} = await this._dialogService.confirm({
|
|
742
742
|
type: Severity.Warning,
|
|
743
|
-
message: ( localize(
|
|
743
|
+
message: ( localize(16087, "Please confirm restart of extensions.")),
|
|
744
744
|
detail: vetoReasonsArray.length === 1 ? vetoReasonsArray[0] : vetoReasonsArray.join("\n -"),
|
|
745
|
-
primaryButton: ( localize(
|
|
745
|
+
primaryButton: ( localize(16088, "Restart Anyway"))
|
|
746
746
|
});
|
|
747
747
|
if (confirmed) {
|
|
748
748
|
return true;
|
|
@@ -856,16 +856,16 @@ let AbstractExtensionService = AbstractExtensionService_1 = class AbstractExtens
|
|
|
856
856
|
this._remoteCrashTracker.registerCrash();
|
|
857
857
|
if (this._remoteCrashTracker.shouldAutomaticallyRestart()) {
|
|
858
858
|
this._logService.info(`Automatically restarting the remote extension host.`);
|
|
859
|
-
this._notificationService.status(( localize(
|
|
859
|
+
this._notificationService.status(( localize(16089, "The remote extension host terminated unexpectedly. Restarting...")), {
|
|
860
860
|
hideAfter: 5000
|
|
861
861
|
});
|
|
862
862
|
this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
|
|
863
863
|
} else {
|
|
864
864
|
this._notificationService.prompt(Severity.Error, ( localize(
|
|
865
|
-
|
|
865
|
+
16090,
|
|
866
866
|
"Remote Extension host terminated unexpectedly 3 times within the last 5 minutes."
|
|
867
867
|
)), [{
|
|
868
|
-
label: ( localize(
|
|
868
|
+
label: ( localize(16091, "Restart Remote Extension Host")),
|
|
869
869
|
run: () => {
|
|
870
870
|
this._startExtensionHostsIfNecessary(false, Array.from(( this._allRequestedActivateEvents.keys())));
|
|
871
871
|
}
|
|
@@ -1413,7 +1413,7 @@ class ActivationFeatureMarkdowneRenderer extends Disposable {
|
|
|
1413
1413
|
}
|
|
1414
1414
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
1415
1415
|
id: "activationEvents",
|
|
1416
|
-
label: ( localize(
|
|
1416
|
+
label: ( localize(16092, "Activation Events")),
|
|
1417
1417
|
access: {
|
|
1418
1418
|
canToggle: false
|
|
1419
1419
|
},
|
|
@@ -485,7 +485,7 @@ registerAction2(class MeasureExtHostLatencyAction extends Action2 {
|
|
|
485
485
|
constructor() {
|
|
486
486
|
super({
|
|
487
487
|
id: "editor.action.measureExtHostLatency",
|
|
488
|
-
title: ( localize2(
|
|
488
|
+
title: ( localize2(16093, "Measure Extension Host Latency")),
|
|
489
489
|
category: Categories.Developer,
|
|
490
490
|
f1: true
|
|
491
491
|
});
|
|
@@ -110,7 +110,7 @@ class ApiProposalsMarkdowneRenderer extends Disposable {
|
|
|
110
110
|
}
|
|
111
111
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
112
112
|
id: "enabledApiProposals",
|
|
113
|
-
label: ( localize(
|
|
113
|
+
label: ( localize(16094, "API Proposals")),
|
|
114
114
|
access: {
|
|
115
115
|
canToggle: false
|
|
116
116
|
},
|
|
@@ -9,7 +9,7 @@ function dedupExtensions(system, user, workspace, development, logService) {
|
|
|
9
9
|
const extension = result.get(systemExtension.identifier);
|
|
10
10
|
if (extension) {
|
|
11
11
|
logService.warn(( localize(
|
|
12
|
-
|
|
12
|
+
16183,
|
|
13
13
|
"Overwriting extension {0} with {1}.",
|
|
14
14
|
extension.extensionLocation.fsPath,
|
|
15
15
|
systemExtension.extensionLocation.fsPath
|
|
@@ -30,7 +30,7 @@ function dedupExtensions(system, user, workspace, development, logService) {
|
|
|
30
30
|
userExtension.isBuiltin = true;
|
|
31
31
|
} else {
|
|
32
32
|
logService.warn(( localize(
|
|
33
|
-
|
|
33
|
+
16183,
|
|
34
34
|
"Overwriting extension {0} with {1}.",
|
|
35
35
|
extension.extensionLocation.fsPath,
|
|
36
36
|
userExtension.extensionLocation.fsPath
|
|
@@ -48,7 +48,7 @@ function dedupExtensions(system, user, workspace, development, logService) {
|
|
|
48
48
|
const extension = result.get(workspaceExtension.identifier);
|
|
49
49
|
if (extension) {
|
|
50
50
|
logService.warn(( localize(
|
|
51
|
-
|
|
51
|
+
16184,
|
|
52
52
|
"Overwriting {0} with Workspace Extension {1}.",
|
|
53
53
|
extension.extensionLocation.fsPath,
|
|
54
54
|
workspaceExtension.extensionLocation.fsPath
|
|
@@ -58,7 +58,7 @@ function dedupExtensions(system, user, workspace, development, logService) {
|
|
|
58
58
|
});
|
|
59
59
|
development.forEach(developedExtension => {
|
|
60
60
|
logService.info(( localize(
|
|
61
|
-
|
|
61
|
+
16185,
|
|
62
62
|
"Loading development extension at {0}",
|
|
63
63
|
developedExtension.extensionLocation.fsPath
|
|
64
64
|
)));
|
|
@@ -22,14 +22,14 @@ const CSS_CACHE_STORAGE_KEY = "workbench.contrib.css.cache";
|
|
|
22
22
|
const cssExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
23
23
|
extensionPoint: "css",
|
|
24
24
|
jsonSchema: {
|
|
25
|
-
description: ( localize(
|
|
25
|
+
description: ( localize(16406, "Contributes CSS files to be loaded in the workbench.")),
|
|
26
26
|
type: "array",
|
|
27
27
|
items: {
|
|
28
28
|
type: "object",
|
|
29
29
|
properties: {
|
|
30
30
|
path: {
|
|
31
31
|
description: ( localize(
|
|
32
|
-
|
|
32
|
+
16407,
|
|
33
33
|
"Path to the CSS file. The path is relative to the extension folder."
|
|
34
34
|
)),
|
|
35
35
|
type: "string"
|
|
@@ -121,7 +121,7 @@ let CSSExtensionPoint = class CSSExtensionPoint {
|
|
|
121
121
|
const extensionValue = extension.value;
|
|
122
122
|
const collector = extension.collector;
|
|
123
123
|
if (!extensionValue || !Array.isArray(extensionValue)) {
|
|
124
|
-
collector.error(( localize(
|
|
124
|
+
collector.error(( localize(16408, "'contributes.css' must be an array.")));
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
127
|
const extensionId = extension.description.identifier.value;
|
|
@@ -166,13 +166,13 @@ let CSSExtensionPoint = class CSSExtensionPoint {
|
|
|
166
166
|
const cssLocations = [];
|
|
167
167
|
for (const cssContribution of extensionValue) {
|
|
168
168
|
if (!cssContribution.path || typeof cssContribution.path !== "string") {
|
|
169
|
-
collector.error(( localize(
|
|
169
|
+
collector.error(( localize(16409, "'contributes.css.path' must be a string.")));
|
|
170
170
|
continue;
|
|
171
171
|
}
|
|
172
172
|
const cssLocation = joinPath(extensionLocation, cssContribution.path);
|
|
173
173
|
if (!isEqualOrParent(cssLocation, extensionLocation)) {
|
|
174
174
|
collector.warn(( localize(
|
|
175
|
-
|
|
175
|
+
16410,
|
|
176
176
|
"Expected 'contributes.css.path' ({0}) to be included inside extension's folder ({1}).",
|
|
177
177
|
cssLocation.path,
|
|
178
178
|
extensionLocation.path
|