@codingame/monaco-vscode-katex-common 28.4.1 → 29.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +158 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +22 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +121 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +29 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +349 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +104 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +21 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +29 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +261 -282
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +184 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +42 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +14 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +11 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +25 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +332 -114
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +10 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +66 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +28 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +272 -107
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.js +70 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +151 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +96 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +86 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +273 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +28 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +81 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +20 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +21 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +2 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +112 -163
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +137 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +108 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +385 -247
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +124 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +84 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +4 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +38 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +31 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +12 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +130 -23
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +41 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +55 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +50 -39
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +0 -440
package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { sep } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
4
|
-
import { raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { AsyncIterableProducer, raceCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
5
|
import { CancellationToken, CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
6
6
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
7
|
-
import { Emitter,
|
|
7
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
8
|
import { Disposable, DisposableMap, DisposableStore, combinedDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
9
|
-
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
|
+
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
10
10
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
11
11
|
import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
12
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
@@ -42,51 +42,52 @@ import { ChatViewId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/con
|
|
|
42
42
|
import { AgentSessionProviders, getAgentSessionProviderName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
43
43
|
import { isCancellationError, BugIndicatingError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
44
44
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
45
|
-
import { LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
45
|
+
import { isUntitledChatSession, LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
46
46
|
import { assertNever } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
47
47
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
48
48
|
import { Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
49
|
-
import { autorun, autorunIterableDelta } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
50
49
|
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
51
|
-
import {
|
|
50
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
52
51
|
|
|
53
52
|
const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
54
53
|
extensionPoint: "chatSessions",
|
|
55
54
|
jsonSchema: {
|
|
56
|
-
description: ( localize(
|
|
55
|
+
description: ( localize(6143, "Contributes chat session integrations to the chat widget.")),
|
|
57
56
|
type: "array",
|
|
58
57
|
items: {
|
|
59
58
|
type: "object",
|
|
60
59
|
additionalProperties: false,
|
|
61
60
|
properties: {
|
|
62
61
|
type: {
|
|
63
|
-
description: ( localize(
|
|
62
|
+
description: ( localize(6144, "Unique identifier for the type of chat session.")),
|
|
64
63
|
type: "string"
|
|
65
64
|
},
|
|
66
65
|
name: {
|
|
67
66
|
description: ( localize(
|
|
68
|
-
|
|
67
|
+
6145,
|
|
69
68
|
"Name of the dynamically registered chat participant (eg: @agent). Must not contain whitespace."
|
|
70
69
|
)),
|
|
71
70
|
type: "string",
|
|
72
71
|
pattern: "^[\\w-]+$"
|
|
73
72
|
},
|
|
74
73
|
displayName: {
|
|
75
|
-
description: ( localize(
|
|
74
|
+
description: ( localize(6146, "A longer name for this item which is used for display in menus.")),
|
|
76
75
|
type: "string"
|
|
77
76
|
},
|
|
78
77
|
description: {
|
|
79
|
-
description: ( localize(
|
|
78
|
+
description: ( localize(6147, "Description of the chat session for use in menus and tooltips.")),
|
|
80
79
|
type: "string"
|
|
81
80
|
},
|
|
82
81
|
when: {
|
|
83
|
-
description: ( localize(
|
|
82
|
+
description: ( localize(6148, "Condition which must be true to show this item.")),
|
|
84
83
|
type: "string"
|
|
85
84
|
},
|
|
86
85
|
icon: {
|
|
87
86
|
description: ( localize(
|
|
88
|
-
|
|
89
|
-
"Icon identifier (codicon ID) for the chat session editor tab. For example, \"
|
|
87
|
+
6149,
|
|
88
|
+
"Icon identifier (codicon ID) for the chat session editor tab. For example, \"{0}\" or \"{1}\".",
|
|
89
|
+
"$(github)",
|
|
90
|
+
"$(cloud)"
|
|
90
91
|
)),
|
|
91
92
|
anyOf: [{
|
|
92
93
|
type: "string"
|
|
@@ -94,22 +95,22 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
94
95
|
type: "object",
|
|
95
96
|
properties: {
|
|
96
97
|
light: {
|
|
97
|
-
description: ( localize(
|
|
98
|
+
description: ( localize(6150, "Icon path when a light theme is used")),
|
|
98
99
|
type: "string"
|
|
99
100
|
},
|
|
100
101
|
dark: {
|
|
101
|
-
description: ( localize(
|
|
102
|
+
description: ( localize(6151, "Icon path when a dark theme is used")),
|
|
102
103
|
type: "string"
|
|
103
104
|
}
|
|
104
105
|
}
|
|
105
106
|
}]
|
|
106
107
|
},
|
|
107
108
|
order: {
|
|
108
|
-
description: ( localize(
|
|
109
|
+
description: ( localize(6152, "Order in which this item should be displayed.")),
|
|
109
110
|
type: "integer"
|
|
110
111
|
},
|
|
111
112
|
alternativeIds: {
|
|
112
|
-
description: ( localize(
|
|
113
|
+
description: ( localize(6153, "Alternative identifiers for backward compatibility.")),
|
|
113
114
|
type: "array",
|
|
114
115
|
items: {
|
|
115
116
|
type: "string"
|
|
@@ -117,95 +118,95 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
117
118
|
},
|
|
118
119
|
welcomeTitle: {
|
|
119
120
|
description: ( localize(
|
|
120
|
-
|
|
121
|
+
6154,
|
|
121
122
|
"Title text to display in the chat welcome view for this session type."
|
|
122
123
|
)),
|
|
123
124
|
type: "string"
|
|
124
125
|
},
|
|
125
126
|
welcomeMessage: {
|
|
126
127
|
description: ( localize(
|
|
127
|
-
|
|
128
|
+
6155,
|
|
128
129
|
"Message text (supports markdown) to display in the chat welcome view for this session type."
|
|
129
130
|
)),
|
|
130
131
|
type: "string"
|
|
131
132
|
},
|
|
132
133
|
welcomeTips: {
|
|
133
134
|
description: ( localize(
|
|
134
|
-
|
|
135
|
+
6156,
|
|
135
136
|
"Tips text (supports markdown and theme icons) to display in the chat welcome view for this session type."
|
|
136
137
|
)),
|
|
137
138
|
type: "string"
|
|
138
139
|
},
|
|
139
140
|
inputPlaceholder: {
|
|
140
141
|
description: ( localize(
|
|
141
|
-
|
|
142
|
+
6157,
|
|
142
143
|
"Placeholder text to display in the chat input box for this session type."
|
|
143
144
|
)),
|
|
144
145
|
type: "string"
|
|
145
146
|
},
|
|
146
147
|
capabilities: {
|
|
147
|
-
description: ( localize(
|
|
148
|
+
description: ( localize(6158, "Optional capabilities for this chat session.")),
|
|
148
149
|
type: "object",
|
|
149
150
|
additionalProperties: false,
|
|
150
151
|
properties: {
|
|
151
152
|
supportsFileAttachments: {
|
|
152
153
|
description: ( localize(
|
|
153
|
-
|
|
154
|
+
6159,
|
|
154
155
|
"Whether this chat session supports attaching files or file references."
|
|
155
156
|
)),
|
|
156
157
|
type: "boolean"
|
|
157
158
|
},
|
|
158
159
|
supportsToolAttachments: {
|
|
159
160
|
description: ( localize(
|
|
160
|
-
|
|
161
|
+
6160,
|
|
161
162
|
"Whether this chat session supports attaching tools or tool references."
|
|
162
163
|
)),
|
|
163
164
|
type: "boolean"
|
|
164
165
|
},
|
|
165
166
|
supportsMCPAttachments: {
|
|
166
|
-
description: ( localize(
|
|
167
|
+
description: ( localize(6161, "Whether this chat session supports attaching MCP resources.")),
|
|
167
168
|
type: "boolean"
|
|
168
169
|
},
|
|
169
170
|
supportsImageAttachments: {
|
|
170
|
-
description: ( localize(
|
|
171
|
+
description: ( localize(6162, "Whether this chat session supports attaching images.")),
|
|
171
172
|
type: "boolean"
|
|
172
173
|
},
|
|
173
174
|
supportsSearchResultAttachments: {
|
|
174
|
-
description: ( localize(
|
|
175
|
+
description: ( localize(6163, "Whether this chat session supports attaching search results.")),
|
|
175
176
|
type: "boolean"
|
|
176
177
|
},
|
|
177
178
|
supportsInstructionAttachments: {
|
|
178
|
-
description: ( localize(
|
|
179
|
+
description: ( localize(6164, "Whether this chat session supports attaching instructions.")),
|
|
179
180
|
type: "boolean"
|
|
180
181
|
},
|
|
181
182
|
supportsSourceControlAttachments: {
|
|
182
183
|
description: ( localize(
|
|
183
|
-
|
|
184
|
+
6165,
|
|
184
185
|
"Whether this chat session supports attaching source control changes."
|
|
185
186
|
)),
|
|
186
187
|
type: "boolean"
|
|
187
188
|
},
|
|
188
189
|
supportsProblemAttachments: {
|
|
189
|
-
description: ( localize(
|
|
190
|
+
description: ( localize(6166, "Whether this chat session supports attaching problems.")),
|
|
190
191
|
type: "boolean"
|
|
191
192
|
},
|
|
192
193
|
supportsSymbolAttachments: {
|
|
193
|
-
description: ( localize(
|
|
194
|
+
description: ( localize(6167, "Whether this chat session supports attaching symbols.")),
|
|
194
195
|
type: "boolean"
|
|
195
196
|
},
|
|
196
197
|
supportsPromptAttachments: {
|
|
197
|
-
description: ( localize(
|
|
198
|
+
description: ( localize(6168, "Whether this chat session supports attaching prompts.")),
|
|
198
199
|
type: "boolean"
|
|
199
200
|
},
|
|
200
201
|
supportsHandOffs: {
|
|
201
|
-
description: ( localize(
|
|
202
|
+
description: ( localize(6169, "Whether this chat session supports hand-off prompts.")),
|
|
202
203
|
type: "boolean"
|
|
203
204
|
}
|
|
204
205
|
}
|
|
205
206
|
},
|
|
206
207
|
commands: {
|
|
207
208
|
markdownDescription: ( localize(
|
|
208
|
-
|
|
209
|
+
6170,
|
|
209
210
|
"Commands available for this chat session, which the user can invoke with a `/`."
|
|
210
211
|
)),
|
|
211
212
|
type: "array",
|
|
@@ -222,17 +223,17 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
222
223
|
properties: {
|
|
223
224
|
name: {
|
|
224
225
|
description: ( localize(
|
|
225
|
-
|
|
226
|
+
6171,
|
|
226
227
|
"A short name by which this command is referred to in the UI, e.g. `fix` or `explain` for commands that fix an issue or explain code. The name should be unique among the commands provided by this participant."
|
|
227
228
|
)),
|
|
228
229
|
type: "string"
|
|
229
230
|
},
|
|
230
231
|
description: {
|
|
231
|
-
description: ( localize(
|
|
232
|
+
description: ( localize(6172, "A description of this command.")),
|
|
232
233
|
type: "string"
|
|
233
234
|
},
|
|
234
235
|
when: {
|
|
235
|
-
description: ( localize(
|
|
236
|
+
description: ( localize(6173, "A condition which must be true to enable this command.")),
|
|
236
237
|
type: "string"
|
|
237
238
|
}
|
|
238
239
|
}
|
|
@@ -240,7 +241,7 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
240
241
|
},
|
|
241
242
|
canDelegate: {
|
|
242
243
|
description: ( localize(
|
|
243
|
-
|
|
244
|
+
6174,
|
|
244
245
|
"Whether delegation is supported. Default is false. Note that enabling this is experimental and may not be respected at all times."
|
|
245
246
|
)),
|
|
246
247
|
type: "boolean",
|
|
@@ -248,18 +249,26 @@ const extensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
248
249
|
},
|
|
249
250
|
customAgentTarget: {
|
|
250
251
|
description: ( localize(
|
|
251
|
-
|
|
252
|
+
6175,
|
|
252
253
|
"When set, the chat session will show a filtered mode picker that prefers custom agents whose target property matches this value. Custom agents without a target property are still shown in all session types. This enables the use of standard agent/mode with contributed sessions."
|
|
253
254
|
)),
|
|
254
255
|
type: "string"
|
|
255
256
|
},
|
|
256
257
|
requiresCustomModels: {
|
|
257
258
|
description: ( localize(
|
|
258
|
-
|
|
259
|
+
6176,
|
|
259
260
|
"When set, the chat session will show a filtered model picker that prefers custom models. This enables the use of standard model picker with contributed sessions."
|
|
260
261
|
)),
|
|
261
262
|
type: "boolean",
|
|
262
263
|
default: false
|
|
264
|
+
},
|
|
265
|
+
autoAttachReferences: {
|
|
266
|
+
description: ( localize(
|
|
267
|
+
6177,
|
|
268
|
+
"Whether to automatically attach instruction files to chat requests for this session type."
|
|
269
|
+
)),
|
|
270
|
+
type: "boolean",
|
|
271
|
+
default: false
|
|
263
272
|
}
|
|
264
273
|
},
|
|
265
274
|
required: ["type", "name", "displayName", "description"]
|
|
@@ -275,6 +284,9 @@ class ContributedChatSessionData extends Disposable {
|
|
|
275
284
|
getOption(optionId) {
|
|
276
285
|
return this._optionsCache.get(optionId);
|
|
277
286
|
}
|
|
287
|
+
getAllOptions() {
|
|
288
|
+
return this._optionsCache.entries();
|
|
289
|
+
}
|
|
278
290
|
setOption(optionId, value) {
|
|
279
291
|
this._optionsCache.set(optionId, value);
|
|
280
292
|
}
|
|
@@ -285,12 +297,7 @@ class ContributedChatSessionData extends Disposable {
|
|
|
285
297
|
this.resource = resource;
|
|
286
298
|
this.options = options;
|
|
287
299
|
this.onWillDispose = onWillDispose;
|
|
288
|
-
this._optionsCache = ( new Map());
|
|
289
|
-
if (options) {
|
|
290
|
-
for (const [key, value] of Object.entries(options)) {
|
|
291
|
-
this._optionsCache.set(key, value);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
300
|
+
this._optionsCache = ( new Map(options));
|
|
294
301
|
this._register(this.session.onWillDispose(() => {
|
|
295
302
|
this.onWillDispose(this.resource);
|
|
296
303
|
}));
|
|
@@ -309,9 +316,6 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
309
316
|
get onDidChangeOptionGroups() {
|
|
310
317
|
return this._onDidChangeOptionGroups.event;
|
|
311
318
|
}
|
|
312
|
-
get onRequestNotifyExtension() {
|
|
313
|
-
return this._onRequestNotifyExtension.event;
|
|
314
|
-
}
|
|
315
319
|
constructor(
|
|
316
320
|
_logService,
|
|
317
321
|
_chatAgentService,
|
|
@@ -345,21 +349,15 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
345
349
|
this._onDidChangeContentProviderSchemes = this._register(( new Emitter()));
|
|
346
350
|
this._onDidChangeSessionOptions = this._register(( new Emitter()));
|
|
347
351
|
this._onDidChangeOptionGroups = this._register(( new Emitter()));
|
|
348
|
-
this._onRequestNotifyExtension = this._register(( new AsyncEmitter()));
|
|
349
352
|
this.inProgressMap = ( new Map());
|
|
350
353
|
this._sessionTypeOptions = ( new Map());
|
|
351
354
|
this._sessionTypeNewSessionOptions = ( new Map());
|
|
352
|
-
this._sessionTypeIcons = ( new Map());
|
|
353
|
-
this._sessionTypeWelcomeTitles = ( new Map());
|
|
354
|
-
this._sessionTypeWelcomeMessages = ( new Map());
|
|
355
|
-
this._sessionTypeWelcomeTips = ( new Map());
|
|
356
|
-
this._sessionTypeInputPlaceholders = ( new Map());
|
|
357
355
|
this._sessions = ( new ResourceMap());
|
|
358
356
|
this._resourceAliases = ( new ResourceMap());
|
|
359
357
|
this._hasCanDelegateProvidersKey = ChatContextKeys.hasCanDelegateProviders.bindTo(this._contextKeyService);
|
|
360
358
|
this._register(extensionPoint.setHandler(extensions => {
|
|
361
359
|
for (const ext of extensions) {
|
|
362
|
-
if (!isProposedApiEnabled(ext.description
|
|
360
|
+
if (!isProposedApiEnabled(ext.description)) {
|
|
363
361
|
continue;
|
|
364
362
|
}
|
|
365
363
|
if (!Array.isArray(ext.value)) {
|
|
@@ -388,15 +386,6 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
388
386
|
}
|
|
389
387
|
}
|
|
390
388
|
}));
|
|
391
|
-
this._register(this.onDidChangeSessionItems((
|
|
392
|
-
{
|
|
393
|
-
chatSessionType
|
|
394
|
-
}
|
|
395
|
-
) => {
|
|
396
|
-
this.updateInProgressStatus(chatSessionType).catch(error => {
|
|
397
|
-
this._logService.warn(`Failed to update progress status for '${chatSessionType}':`, error);
|
|
398
|
-
});
|
|
399
|
-
}));
|
|
400
389
|
this._register(this._labelService.registerFormatter({
|
|
401
390
|
scheme: Schemas.copilotPr,
|
|
402
391
|
formatting: {
|
|
@@ -407,31 +396,26 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
407
396
|
}));
|
|
408
397
|
}
|
|
409
398
|
reportInProgress(chatSessionType, count) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
displayName = ( localize(6045, "Background Agent"));
|
|
415
|
-
} else if (chatSessionType === AgentSessionProviders.Cloud) {
|
|
416
|
-
displayName = ( localize(6046, "Cloud Agent"));
|
|
417
|
-
} else {
|
|
418
|
-
displayName = this._contributions.get(chatSessionType)?.contribution.displayName;
|
|
419
|
-
}
|
|
420
|
-
if (displayName) {
|
|
421
|
-
this.inProgressMap.set(displayName, count);
|
|
399
|
+
if (!( this._itemControllers.has(chatSessionType))) {
|
|
400
|
+
this._logService.warn(
|
|
401
|
+
`Attempted to report in-progress status for unknown chat session type '${chatSessionType}'`
|
|
402
|
+
);
|
|
422
403
|
}
|
|
404
|
+
this.inProgressMap.set(chatSessionType, count);
|
|
423
405
|
this._onDidChangeInProgress.fire();
|
|
424
406
|
}
|
|
425
407
|
getInProgress() {
|
|
426
|
-
return ( Array.from(this.inProgressMap.entries()).map(([
|
|
427
|
-
|
|
408
|
+
return ( Array.from(this.inProgressMap.entries()).map(([chatSessionType, count]) => ({
|
|
409
|
+
chatSessionType,
|
|
428
410
|
count
|
|
429
411
|
})));
|
|
430
412
|
}
|
|
431
413
|
async updateInProgressStatus(chatSessionType) {
|
|
432
414
|
try {
|
|
433
|
-
const
|
|
434
|
-
const
|
|
415
|
+
const items = [];
|
|
416
|
+
for await (const result of this.getChatSessionItems([chatSessionType], CancellationToken.None)) {
|
|
417
|
+
items.push(...result.items);
|
|
418
|
+
}
|
|
435
419
|
const inProgress = items.filter(item => item.status && isSessionInProgressStatus(item.status));
|
|
436
420
|
this.reportInProgress(chatSessionType, inProgress.length);
|
|
437
421
|
} catch (error) {
|
|
@@ -442,16 +426,14 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
442
426
|
}
|
|
443
427
|
}
|
|
444
428
|
registerContribution(contribution, ext) {
|
|
445
|
-
this._logService.
|
|
429
|
+
this._logService.trace(
|
|
446
430
|
`[ChatSessionsService] registerContribution called for type='${contribution.type}', canDelegate=${contribution.canDelegate}, when='${contribution.when}', extension='${ext.identifier.value}'`
|
|
447
431
|
);
|
|
448
432
|
if (( this._contributions.has(contribution.type))) {
|
|
449
|
-
this._logService.
|
|
433
|
+
this._logService.trace(
|
|
450
434
|
`[ChatSessionsService] registerContribution: type='${contribution.type}' already registered, skipping`
|
|
451
435
|
);
|
|
452
|
-
return
|
|
453
|
-
dispose: () => {}
|
|
454
|
-
};
|
|
436
|
+
return Disposable.None;
|
|
455
437
|
}
|
|
456
438
|
if (contribution.when) {
|
|
457
439
|
const whenExpr = ContextKeyExpr.deserialize(contribution.when);
|
|
@@ -475,32 +457,6 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
475
457
|
this._alternativeIdMap.set(altId, contribution.type);
|
|
476
458
|
}
|
|
477
459
|
}
|
|
478
|
-
let icon;
|
|
479
|
-
if (contribution.icon) {
|
|
480
|
-
if (typeof contribution.icon === "string") {
|
|
481
|
-
icon = contribution.icon.startsWith("$(") && contribution.icon.endsWith(")") ? ThemeIcon.fromString(contribution.icon) : ThemeIcon.fromId(contribution.icon);
|
|
482
|
-
} else {
|
|
483
|
-
icon = {
|
|
484
|
-
dark: joinPath(ext.extensionLocation, contribution.icon.dark),
|
|
485
|
-
light: joinPath(ext.extensionLocation, contribution.icon.light)
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
if (icon) {
|
|
490
|
-
this._sessionTypeIcons.set(contribution.type, icon);
|
|
491
|
-
}
|
|
492
|
-
if (contribution.welcomeTitle) {
|
|
493
|
-
this._sessionTypeWelcomeTitles.set(contribution.type, contribution.welcomeTitle);
|
|
494
|
-
}
|
|
495
|
-
if (contribution.welcomeMessage) {
|
|
496
|
-
this._sessionTypeWelcomeMessages.set(contribution.type, contribution.welcomeMessage);
|
|
497
|
-
}
|
|
498
|
-
if (contribution.welcomeTips) {
|
|
499
|
-
this._sessionTypeWelcomeTips.set(contribution.type, contribution.welcomeTips);
|
|
500
|
-
}
|
|
501
|
-
if (contribution.inputPlaceholder) {
|
|
502
|
-
this._sessionTypeInputPlaceholders.set(contribution.type, contribution.inputPlaceholder);
|
|
503
|
-
}
|
|
504
460
|
this._evaluateAvailability();
|
|
505
461
|
return {
|
|
506
462
|
dispose: () => {
|
|
@@ -512,11 +468,6 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
512
468
|
}
|
|
513
469
|
}
|
|
514
470
|
}
|
|
515
|
-
this._sessionTypeIcons.delete(contribution.type);
|
|
516
|
-
this._sessionTypeWelcomeTitles.delete(contribution.type);
|
|
517
|
-
this._sessionTypeWelcomeMessages.delete(contribution.type);
|
|
518
|
-
this._sessionTypeWelcomeTips.delete(contribution.type);
|
|
519
|
-
this._sessionTypeInputPlaceholders.delete(contribution.type);
|
|
520
471
|
this._contributionDisposables.deleteAndDispose(contribution.type);
|
|
521
472
|
this._updateHasCanDelegateProvidersContextKey();
|
|
522
473
|
}
|
|
@@ -575,7 +526,7 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
575
526
|
constructor() {
|
|
576
527
|
super({
|
|
577
528
|
id: `workbench.action.chat.openSessionWithPrompt.${contribution.type}`,
|
|
578
|
-
title: ( localize2(
|
|
529
|
+
title: ( localize2(6178, "New {0} with Prompt", contribution.displayName)),
|
|
579
530
|
category: CHAT_CATEGORY,
|
|
580
531
|
icon: Codicon.plus,
|
|
581
532
|
f1: false,
|
|
@@ -610,7 +561,7 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
610
561
|
constructor() {
|
|
611
562
|
super({
|
|
612
563
|
id: `workbench.action.chat.openNewSessionEditor.${contribution.type}`,
|
|
613
|
-
title: ( localize2(
|
|
564
|
+
title: ( localize2(6179, "New {0}", contribution.displayName)),
|
|
614
565
|
category: CHAT_CATEGORY,
|
|
615
566
|
icon: Codicon.plus,
|
|
616
567
|
f1: true,
|
|
@@ -633,7 +584,7 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
633
584
|
constructor() {
|
|
634
585
|
super({
|
|
635
586
|
id: `workbench.action.chat.openNewSessionSidebar.${contribution.type}`,
|
|
636
|
-
title: ( localize2(
|
|
587
|
+
title: ( localize2(6180, "New {0}", contribution.displayName)),
|
|
637
588
|
category: CHAT_CATEGORY,
|
|
638
589
|
icon: Codicon.plus,
|
|
639
590
|
f1: false,
|
|
@@ -658,7 +609,9 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
658
609
|
}));
|
|
659
610
|
}
|
|
660
611
|
_evaluateAvailability() {
|
|
661
|
-
|
|
612
|
+
const newlyEnabledChatSessionTypes = ( new Set());
|
|
613
|
+
const newlyDisabledChatSessionTypes = ( new Set());
|
|
614
|
+
const disposedChatSessions = ( new ResourceSet());
|
|
662
615
|
for (const {
|
|
663
616
|
contribution,
|
|
664
617
|
extension
|
|
@@ -670,32 +623,34 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
670
623
|
);
|
|
671
624
|
if (isCurrentlyRegistered && !shouldBeRegistered) {
|
|
672
625
|
this._contributionDisposables.deleteAndDispose(contribution.type);
|
|
673
|
-
this._disposeSessionsForContribution(contribution.type)
|
|
674
|
-
|
|
626
|
+
for (const sessionResource of this._disposeSessionsForContribution(contribution.type)) {
|
|
627
|
+
disposedChatSessions.add(sessionResource);
|
|
628
|
+
}
|
|
629
|
+
newlyDisabledChatSessionTypes.add(contribution.type);
|
|
675
630
|
} else if (!isCurrentlyRegistered && shouldBeRegistered) {
|
|
676
|
-
|
|
677
|
-
|
|
631
|
+
if (extension) {
|
|
632
|
+
this._enableContribution(contribution, extension);
|
|
633
|
+
}
|
|
634
|
+
newlyEnabledChatSessionTypes.add(contribution.type);
|
|
678
635
|
}
|
|
679
636
|
}
|
|
680
|
-
if (
|
|
637
|
+
if (newlyEnabledChatSessionTypes.size > 0 || newlyDisabledChatSessionTypes.size > 0) {
|
|
681
638
|
this._onDidChangeAvailability.fire();
|
|
682
|
-
for (const chatSessionType of
|
|
639
|
+
for (const chatSessionType of [...newlyEnabledChatSessionTypes, ...newlyDisabledChatSessionTypes]) {
|
|
683
640
|
this._onDidChangeItemsProviders.fire({
|
|
684
641
|
chatSessionType
|
|
685
642
|
});
|
|
686
643
|
}
|
|
687
|
-
|
|
688
|
-
contribution
|
|
689
|
-
} of ( this._contributions.values())) {
|
|
644
|
+
if (disposedChatSessions.size > 0) {
|
|
690
645
|
this._onDidChangeSessionItems.fire({
|
|
691
|
-
|
|
646
|
+
removed: Array.from(disposedChatSessions)
|
|
692
647
|
});
|
|
693
648
|
}
|
|
694
649
|
}
|
|
695
650
|
this._updateHasCanDelegateProvidersContextKey();
|
|
696
651
|
}
|
|
697
652
|
_enableContribution(contribution, ext) {
|
|
698
|
-
this._logService.
|
|
653
|
+
this._logService.trace(
|
|
699
654
|
`[ChatSessionsService] _enableContribution: type='${contribution.type}', canDelegate=${contribution.canDelegate}`
|
|
700
655
|
);
|
|
701
656
|
const disposableStore = ( new DisposableStore());
|
|
@@ -724,15 +679,10 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
724
679
|
sessionData.dispose();
|
|
725
680
|
}
|
|
726
681
|
}
|
|
682
|
+
return sessionsToDispose;
|
|
727
683
|
}
|
|
728
684
|
_registerAgent(contribution, ext) {
|
|
729
|
-
const
|
|
730
|
-
type: id,
|
|
731
|
-
name,
|
|
732
|
-
displayName,
|
|
733
|
-
description
|
|
734
|
-
} = contribution;
|
|
735
|
-
const storedIcon = this._sessionTypeIcons.get(id);
|
|
685
|
+
const storedIcon = this.getContributionIcon(ext, contribution);
|
|
736
686
|
const icons = ThemeIcon.isThemeIcon(storedIcon) ? {
|
|
737
687
|
themeIcon: storedIcon,
|
|
738
688
|
icon: undefined,
|
|
@@ -743,11 +693,12 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
743
693
|
} : {
|
|
744
694
|
themeIcon: Codicon.sendToRemoteAgent
|
|
745
695
|
};
|
|
696
|
+
const id = contribution.type;
|
|
746
697
|
const agentData = {
|
|
747
698
|
id,
|
|
748
|
-
name,
|
|
749
|
-
fullName: displayName,
|
|
750
|
-
description: description,
|
|
699
|
+
name: contribution.name,
|
|
700
|
+
fullName: contribution.displayName,
|
|
701
|
+
description: contribution.description,
|
|
751
702
|
isDefault: false,
|
|
752
703
|
isCore: false,
|
|
753
704
|
isDynamic: true,
|
|
@@ -768,7 +719,9 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
768
719
|
return this._chatAgentService.registerAgent(id, agentData);
|
|
769
720
|
}
|
|
770
721
|
getAllChatSessionContributions() {
|
|
771
|
-
return Array.from(( this._contributions.values())
|
|
722
|
+
return ( Array.from(( this._contributions.values())).filter(entry => this._isContributionAvailable(entry.contribution)).map(
|
|
723
|
+
entry => this.resolveChatSessionContribution(entry.extension, entry.contribution)
|
|
724
|
+
));
|
|
772
725
|
}
|
|
773
726
|
_updateHasCanDelegateProvidersContextKey() {
|
|
774
727
|
const hasCanDelegate = this.getAllChatSessionContributions().filter(c => c.canDelegate);
|
|
@@ -779,11 +732,60 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
779
732
|
this._hasCanDelegateProvidersKey.set(canDelegateEnabled);
|
|
780
733
|
}
|
|
781
734
|
getChatSessionContribution(chatSessionType) {
|
|
782
|
-
const
|
|
783
|
-
if (!
|
|
735
|
+
const entry = this._contributions.get(chatSessionType);
|
|
736
|
+
if (!entry) {
|
|
784
737
|
return undefined;
|
|
785
738
|
}
|
|
786
|
-
|
|
739
|
+
if (!this._isContributionAvailable(entry.contribution)) {
|
|
740
|
+
return undefined;
|
|
741
|
+
}
|
|
742
|
+
return this.resolveChatSessionContribution(entry.extension, entry.contribution);
|
|
743
|
+
}
|
|
744
|
+
resolveChatSessionContribution(ext, contribution) {
|
|
745
|
+
return {
|
|
746
|
+
...contribution,
|
|
747
|
+
icon: this.resolveIconForCurrentColorTheme(this.getContributionIcon(ext, contribution))
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
getContributionIcon(ext, contribution) {
|
|
751
|
+
if (!contribution.icon) {
|
|
752
|
+
return undefined;
|
|
753
|
+
}
|
|
754
|
+
if (typeof contribution.icon === "string") {
|
|
755
|
+
return contribution.icon.startsWith("$(") && contribution.icon.endsWith(")") ? ThemeIcon.fromString(contribution.icon) : ThemeIcon.fromId(contribution.icon);
|
|
756
|
+
}
|
|
757
|
+
return {
|
|
758
|
+
dark: ext ? joinPath(ext.extensionLocation, contribution.icon.dark) : ( URI.parse(contribution.icon.dark)),
|
|
759
|
+
light: ext ? joinPath(ext.extensionLocation, contribution.icon.light) : ( URI.parse(contribution.icon.light))
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
resolveIconForCurrentColorTheme(rawIcon) {
|
|
763
|
+
if (!rawIcon) {
|
|
764
|
+
return undefined;
|
|
765
|
+
}
|
|
766
|
+
if (ThemeIcon.isThemeIcon(rawIcon)) {
|
|
767
|
+
return rawIcon;
|
|
768
|
+
} else if (isDark(this._themeService.getColorTheme().type)) {
|
|
769
|
+
return rawIcon.dark;
|
|
770
|
+
} else {
|
|
771
|
+
return rawIcon.light;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
registerChatSessionContribution(contribution) {
|
|
775
|
+
if (( this._contributions.has(contribution.type))) {
|
|
776
|
+
return {
|
|
777
|
+
dispose: () => {}
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
this._contributions.set(contribution.type, {
|
|
781
|
+
contribution,
|
|
782
|
+
extension: undefined
|
|
783
|
+
});
|
|
784
|
+
this._onDidChangeAvailability.fire();
|
|
785
|
+
return toDisposable(() => {
|
|
786
|
+
this._contributions.delete(contribution.type);
|
|
787
|
+
this._onDidChangeAvailability.fire();
|
|
788
|
+
});
|
|
787
789
|
}
|
|
788
790
|
async activateChatSessionItemProvider(chatViewType) {
|
|
789
791
|
await this.doActivateChatSessionItemController(chatViewType);
|
|
@@ -832,24 +834,46 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
832
834
|
}
|
|
833
835
|
})));
|
|
834
836
|
}
|
|
835
|
-
|
|
837
|
+
getChatSessionItems(providersToResolve, token) {
|
|
838
|
+
return new AsyncIterableProducer(async writer => {
|
|
839
|
+
await raceCancellationError(this.tryActivateControllers(providersToResolve), token);
|
|
840
|
+
await Promise.all(
|
|
841
|
+
Array.from(this._itemControllers, async ([chatSessionType, controllerEntry]) => {
|
|
842
|
+
const resolvedType = this._resolveToPrimaryType(chatSessionType) ?? chatSessionType;
|
|
843
|
+
if (providersToResolve && !providersToResolve.includes(resolvedType)) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
try {
|
|
847
|
+
await raceCancellationError(controllerEntry.initialRefresh, token);
|
|
848
|
+
const providerSessions = controllerEntry.controller.items;
|
|
849
|
+
this._logService.trace(
|
|
850
|
+
`[ChatSessionsService] Resolved ${providerSessions.length} sessions for provider ${resolvedType}`
|
|
851
|
+
);
|
|
852
|
+
writer.emitOne({
|
|
853
|
+
chatSessionType: resolvedType,
|
|
854
|
+
items: providerSessions
|
|
855
|
+
});
|
|
856
|
+
} catch (err) {
|
|
857
|
+
if (!isCancellationError(err)) {
|
|
858
|
+
this._logService.error(
|
|
859
|
+
`[ChatSessionsService] Failed to resolve sessions for provider ${resolvedType}`,
|
|
860
|
+
err
|
|
861
|
+
);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
})
|
|
865
|
+
);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
async refreshChatSessionItems(providersToResolve, token) {
|
|
836
869
|
await this.tryActivateControllers(providersToResolve);
|
|
837
|
-
const results = [];
|
|
838
870
|
await Promise.all(( Array.from(this._itemControllers).map(async ([chatSessionType, controllerEntry]) => {
|
|
839
871
|
const resolvedType = this._resolveToPrimaryType(chatSessionType) ?? chatSessionType;
|
|
840
872
|
if (providersToResolve && !providersToResolve.includes(resolvedType)) {
|
|
841
873
|
return;
|
|
842
874
|
}
|
|
843
875
|
try {
|
|
844
|
-
await controllerEntry.
|
|
845
|
-
const providerSessions = controllerEntry.controller.items;
|
|
846
|
-
this._logService.trace(
|
|
847
|
-
`[ChatSessionsService] Resolved ${providerSessions.length} sessions for provider ${resolvedType}`
|
|
848
|
-
);
|
|
849
|
-
results.push({
|
|
850
|
-
chatSessionType: resolvedType,
|
|
851
|
-
items: providerSessions
|
|
852
|
-
});
|
|
876
|
+
await controllerEntry.controller.refresh(token);
|
|
853
877
|
} catch (err) {
|
|
854
878
|
if (!isCancellationError(err)) {
|
|
855
879
|
this._logService.error(
|
|
@@ -859,22 +883,9 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
859
883
|
}
|
|
860
884
|
}
|
|
861
885
|
})));
|
|
862
|
-
return results;
|
|
863
886
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
await Promise.all(( Array.from(this._itemControllers).map(async ([chatSessionType, controllerEntry]) => {
|
|
867
|
-
try {
|
|
868
|
-
await controllerEntry.controller.refresh(token);
|
|
869
|
-
} catch (err) {
|
|
870
|
-
if (!isCancellationError(err)) {
|
|
871
|
-
this._logService.error(
|
|
872
|
-
`[ChatSessionsService] Failed to resolve sessions for provider ${chatSessionType}`,
|
|
873
|
-
err
|
|
874
|
-
);
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
})));
|
|
887
|
+
getRegisteredChatSessionItemProviders() {
|
|
888
|
+
return [...( new Set(( Array.from(( this._itemControllers.keys())).map(key => this._resolveToPrimaryType(key) ?? key))))];
|
|
878
889
|
}
|
|
879
890
|
registerChatSessionItemController(chatSessionType, controller) {
|
|
880
891
|
const disposables = ( new DisposableStore());
|
|
@@ -886,17 +897,10 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
886
897
|
this._onDidChangeItemsProviders.fire({
|
|
887
898
|
chatSessionType
|
|
888
899
|
});
|
|
889
|
-
disposables.add(controller.onDidChangeChatSessionItems(
|
|
890
|
-
this._onDidChangeSessionItems.fire(
|
|
891
|
-
|
|
892
|
-
});
|
|
900
|
+
disposables.add(controller.onDidChangeChatSessionItems(e => {
|
|
901
|
+
this._onDidChangeSessionItems.fire(e);
|
|
902
|
+
this.updateInProgressStatus(chatSessionType);
|
|
893
903
|
}));
|
|
894
|
-
this.updateInProgressStatus(chatSessionType).catch(error => {
|
|
895
|
-
this._logService.warn(
|
|
896
|
-
`Failed to update initial progress status for '${chatSessionType}':`,
|
|
897
|
-
error
|
|
898
|
-
);
|
|
899
|
-
});
|
|
900
904
|
return {
|
|
901
905
|
dispose: () => {
|
|
902
906
|
initialRefreshCts.cancel();
|
|
@@ -908,6 +912,7 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
908
912
|
chatSessionType
|
|
909
913
|
});
|
|
910
914
|
}
|
|
915
|
+
this.updateInProgressStatus(chatSessionType);
|
|
911
916
|
}
|
|
912
917
|
};
|
|
913
918
|
}
|
|
@@ -936,45 +941,6 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
936
941
|
}
|
|
937
942
|
};
|
|
938
943
|
}
|
|
939
|
-
registerChatModelChangeListeners(chatService, chatSessionType, onChange) {
|
|
940
|
-
const disposableStore = ( new DisposableStore());
|
|
941
|
-
const chatModelsICareAbout = ( chatService.chatModels.map(
|
|
942
|
-
models => Array.from(models).filter(model => model.sessionResource.scheme === chatSessionType)
|
|
943
|
-
));
|
|
944
|
-
const listeners = ( new ResourceMap());
|
|
945
|
-
const autoRunDisposable = autorunIterableDelta(reader => chatModelsICareAbout.read(reader), (
|
|
946
|
-
{
|
|
947
|
-
addedValues,
|
|
948
|
-
removedValues
|
|
949
|
-
}
|
|
950
|
-
) => {
|
|
951
|
-
removedValues.forEach(removed => {
|
|
952
|
-
const listener = listeners.get(removed.sessionResource);
|
|
953
|
-
if (listener) {
|
|
954
|
-
listeners.delete(removed.sessionResource);
|
|
955
|
-
listener.dispose();
|
|
956
|
-
}
|
|
957
|
-
});
|
|
958
|
-
addedValues.forEach(added => {
|
|
959
|
-
const requestChangeListener = ( added.lastRequestObs.map(
|
|
960
|
-
last => last?.response && observableSignalFromEvent("chatSessions.modelRequestChangeListener", last.response.onDidChange)
|
|
961
|
-
));
|
|
962
|
-
const modelChangeListener = observableSignalFromEvent("chatSessions.modelChangeListener", added.onDidChange);
|
|
963
|
-
listeners.set(added.sessionResource, autorun(reader => {
|
|
964
|
-
requestChangeListener.read(reader)?.read(reader);
|
|
965
|
-
modelChangeListener.read(reader);
|
|
966
|
-
onChange();
|
|
967
|
-
}));
|
|
968
|
-
});
|
|
969
|
-
});
|
|
970
|
-
disposableStore.add(toDisposable(() => {
|
|
971
|
-
for (const listener of ( listeners.values())) {
|
|
972
|
-
listener.dispose();
|
|
973
|
-
}
|
|
974
|
-
}));
|
|
975
|
-
disposableStore.add(autoRunDisposable);
|
|
976
|
-
return disposableStore;
|
|
977
|
-
}
|
|
978
944
|
getInProgressSessionDescription(chatModel) {
|
|
979
945
|
const requests = chatModel.getRequests();
|
|
980
946
|
if (requests.length === 0) {
|
|
@@ -1005,14 +971,14 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1005
971
|
const confirmationTitle = state.confirmationMessages?.title;
|
|
1006
972
|
const titleMessage = confirmationTitle && (typeof confirmationTitle === "string" ? confirmationTitle : confirmationTitle.value);
|
|
1007
973
|
const descriptionValue = typeof description === "string" ? description : description.value;
|
|
1008
|
-
description = titleMessage ?? ( localize(
|
|
974
|
+
description = titleMessage ?? ( localize(6181, "Waiting for confirmation: {0}", descriptionValue));
|
|
1009
975
|
}
|
|
1010
976
|
} else if (part.kind === "toolInvocationSerialized") {
|
|
1011
977
|
description = part.invocationMessage;
|
|
1012
978
|
} else if (part.kind === "progressMessage") {
|
|
1013
979
|
description = part.content;
|
|
1014
980
|
} else if (part.kind === "thinking") {
|
|
1015
|
-
description = ( localize(
|
|
981
|
+
description = ( localize(6182, "Thinking..."));
|
|
1016
982
|
}
|
|
1017
983
|
}
|
|
1018
984
|
return description ? renderAsPlaintext(description, {
|
|
@@ -1050,7 +1016,7 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1050
1016
|
}
|
|
1051
1017
|
let session;
|
|
1052
1018
|
const newSessionOptions = this.getNewSessionOptionsForSessionType(resolvedType);
|
|
1053
|
-
if (sessionResource
|
|
1019
|
+
if (isUntitledChatSession(sessionResource) && newSessionOptions) {
|
|
1054
1020
|
session = {
|
|
1055
1021
|
sessionResource: sessionResource,
|
|
1056
1022
|
onWillDispose: Event.None,
|
|
@@ -1061,8 +1027,10 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1061
1027
|
} else {
|
|
1062
1028
|
session = await raceCancellationError(provider.provideChatSessionContent(sessionResource, token), token);
|
|
1063
1029
|
}
|
|
1064
|
-
|
|
1065
|
-
|
|
1030
|
+
if (session.options) {
|
|
1031
|
+
for (const [optionId, value] of session.options) {
|
|
1032
|
+
this.setSessionOption(sessionResource, optionId, value);
|
|
1033
|
+
}
|
|
1066
1034
|
}
|
|
1067
1035
|
{
|
|
1068
1036
|
const existingSessionData = this._sessions.get(sessionResource);
|
|
@@ -1082,20 +1050,56 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1082
1050
|
}
|
|
1083
1051
|
));
|
|
1084
1052
|
this._sessions.set(sessionResource, sessionData);
|
|
1085
|
-
|
|
1053
|
+
if (session.options) {
|
|
1054
|
+
this._onDidChangeSessionOptions.fire({
|
|
1055
|
+
sessionResource,
|
|
1056
|
+
updates: session.options
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1086
1059
|
return session;
|
|
1087
1060
|
}
|
|
1088
1061
|
hasAnySessionOptions(sessionResource) {
|
|
1089
1062
|
const session = this._sessions.get(this._resolveResource(sessionResource));
|
|
1090
|
-
return !!session && !!session.options &&
|
|
1063
|
+
return !!session && !!session.options && session.options.size > 0;
|
|
1064
|
+
}
|
|
1065
|
+
getSessionOptions(sessionResource) {
|
|
1066
|
+
const session = this._sessions.get(this._resolveResource(sessionResource));
|
|
1067
|
+
if (!session) {
|
|
1068
|
+
return undefined;
|
|
1069
|
+
}
|
|
1070
|
+
const result = ( new Map());
|
|
1071
|
+
for (const [key, value] of session.getAllOptions()) {
|
|
1072
|
+
result.set(key, typeof value === "string" ? value : value.id);
|
|
1073
|
+
}
|
|
1074
|
+
return result.size > 0 ? result : undefined;
|
|
1091
1075
|
}
|
|
1092
1076
|
getSessionOption(sessionResource, optionId) {
|
|
1093
1077
|
const session = this._sessions.get(this._resolveResource(sessionResource));
|
|
1094
1078
|
return session?.getOption(optionId);
|
|
1095
1079
|
}
|
|
1096
1080
|
setSessionOption(sessionResource, optionId, value) {
|
|
1081
|
+
return this.updateSessionOptions(sessionResource, ( new Map([[optionId, value]])));
|
|
1082
|
+
}
|
|
1083
|
+
updateSessionOptions(sessionResource, updates) {
|
|
1097
1084
|
const session = this._sessions.get(this._resolveResource(sessionResource));
|
|
1098
|
-
|
|
1085
|
+
if (!session) {
|
|
1086
|
+
return false;
|
|
1087
|
+
}
|
|
1088
|
+
let didChange = false;
|
|
1089
|
+
for (const [optionId, value] of updates) {
|
|
1090
|
+
const existingValue = session.getOption(optionId);
|
|
1091
|
+
if (existingValue !== value) {
|
|
1092
|
+
session.setOption(optionId, value);
|
|
1093
|
+
didChange = true;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
if (didChange) {
|
|
1097
|
+
this._onDidChangeSessionOptions.fire({
|
|
1098
|
+
sessionResource,
|
|
1099
|
+
updates: updates
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
return didChange;
|
|
1099
1103
|
}
|
|
1100
1104
|
_resolveResource(resource) {
|
|
1101
1105
|
return this._resourceAliases.get(resource) ?? resource;
|
|
@@ -1115,52 +1119,14 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1115
1119
|
return this._sessionTypeOptions.get(chatSessionType);
|
|
1116
1120
|
}
|
|
1117
1121
|
getNewSessionOptionsForSessionType(chatSessionType) {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
this._sessionTypeNewSessionOptions.set(chatSessionType, options);
|
|
1122
|
-
}
|
|
1123
|
-
async notifySessionOptionsChange(sessionResource, updates) {
|
|
1124
|
-
if (!updates.length) {
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
this._logService.trace(
|
|
1128
|
-
`[ChatSessionsService] notifySessionOptionsChange: starting for ${sessionResource}, ${updates.length} update(s): [${( updates.map(u => u.optionId)).join(", ")}]`
|
|
1129
|
-
);
|
|
1130
|
-
await this._onRequestNotifyExtension.fireAsync({
|
|
1131
|
-
sessionResource,
|
|
1132
|
-
updates
|
|
1133
|
-
}, CancellationToken.None);
|
|
1134
|
-
this._logService.trace(
|
|
1135
|
-
`[ChatSessionsService] notifySessionOptionsChange: fireAsync completed for ${sessionResource}`
|
|
1136
|
-
);
|
|
1137
|
-
for (const u of updates) {
|
|
1138
|
-
this.setSessionOption(sessionResource, u.optionId, u.value);
|
|
1139
|
-
}
|
|
1140
|
-
this._onDidChangeSessionOptions.fire(this._resolveResource(sessionResource));
|
|
1141
|
-
this._logService.trace(
|
|
1142
|
-
`[ChatSessionsService] notifySessionOptionsChange: finished for ${sessionResource}`
|
|
1143
|
-
);
|
|
1144
|
-
}
|
|
1145
|
-
getIconForSessionType(chatSessionType) {
|
|
1146
|
-
const sessionTypeIcon = this._sessionTypeIcons.get(chatSessionType);
|
|
1147
|
-
if (ThemeIcon.isThemeIcon(sessionTypeIcon)) {
|
|
1148
|
-
return sessionTypeIcon;
|
|
1149
|
-
}
|
|
1150
|
-
if (isDark(this._themeService.getColorTheme().type)) {
|
|
1151
|
-
return sessionTypeIcon?.dark;
|
|
1152
|
-
} else {
|
|
1153
|
-
return sessionTypeIcon?.light;
|
|
1122
|
+
const options = this._sessionTypeNewSessionOptions.get(chatSessionType);
|
|
1123
|
+
if (!options || options.size === 0) {
|
|
1124
|
+
return undefined;
|
|
1154
1125
|
}
|
|
1126
|
+
return ( new Map(options));
|
|
1155
1127
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
}
|
|
1159
|
-
getWelcomeMessageForSessionType(chatSessionType) {
|
|
1160
|
-
return this._sessionTypeWelcomeMessages.get(chatSessionType);
|
|
1161
|
-
}
|
|
1162
|
-
getInputPlaceholderForSessionType(chatSessionType) {
|
|
1163
|
-
return this._sessionTypeInputPlaceholders.get(chatSessionType);
|
|
1128
|
+
setNewSessionOptionsForSessionType(chatSessionType, options) {
|
|
1129
|
+
this._sessionTypeNewSessionOptions.set(chatSessionType, ( new Map(options)));
|
|
1164
1130
|
}
|
|
1165
1131
|
getCapabilitiesForSessionType(chatSessionType) {
|
|
1166
1132
|
const contribution = this._contributions.get(chatSessionType)?.contribution;
|
|
@@ -1174,6 +1140,22 @@ let ChatSessionsService = class ChatSessionsService extends Disposable {
|
|
|
1174
1140
|
const contribution = this._contributions.get(chatSessionType)?.contribution;
|
|
1175
1141
|
return !!contribution?.requiresCustomModels;
|
|
1176
1142
|
}
|
|
1143
|
+
supportsDelegationForSessionType(chatSessionType) {
|
|
1144
|
+
const contribution = this._contributions.get(chatSessionType)?.contribution;
|
|
1145
|
+
return contribution?.supportsDelegation !== false;
|
|
1146
|
+
}
|
|
1147
|
+
sessionSupportsFork(sessionResource) {
|
|
1148
|
+
const session =
|
|
1149
|
+
this._sessions.get(sessionResource) ?? this._sessions.get(this._resolveResource(sessionResource));
|
|
1150
|
+
return !!session?.session.forkSession;
|
|
1151
|
+
}
|
|
1152
|
+
async forkChatSession(sessionResource, request, token) {
|
|
1153
|
+
const session = this._sessions.get(this._resolveResource(sessionResource));
|
|
1154
|
+
if (!session?.session.forkSession) {
|
|
1155
|
+
throw ( new Error(`Session ${( sessionResource.toString())} does not support forking`));
|
|
1156
|
+
}
|
|
1157
|
+
return session.session.forkSession(request, token);
|
|
1158
|
+
}
|
|
1177
1159
|
getContentProviderSchemes() {
|
|
1178
1160
|
return Array.from(( this._contentProviders.keys()));
|
|
1179
1161
|
}
|
|
@@ -1184,7 +1166,7 @@ function registerNewSessionInPlaceAction(type, displayName) {
|
|
|
1184
1166
|
constructor() {
|
|
1185
1167
|
super({
|
|
1186
1168
|
id: `workbench.action.chat.openNewChatSessionInPlace.${type}`,
|
|
1187
|
-
title: ( localize2(
|
|
1169
|
+
title: ( localize2(6183, "New {0}", displayName)),
|
|
1188
1170
|
category: CHAT_CATEGORY,
|
|
1189
1171
|
f1: false,
|
|
1190
1172
|
precondition: ChatContextKeys.enabled
|
|
@@ -1200,7 +1182,7 @@ function registerNewSessionInPlaceAction(type, displayName) {
|
|
|
1200
1182
|
}
|
|
1201
1183
|
await openChatSession(accessor, {
|
|
1202
1184
|
type: type,
|
|
1203
|
-
displayName: ( localize(
|
|
1185
|
+
displayName: ( localize(6184, "Chat")),
|
|
1204
1186
|
position: chatSessionPosition,
|
|
1205
1187
|
replaceEditor: true
|
|
1206
1188
|
});
|
|
@@ -1212,7 +1194,7 @@ function registerNewSessionExternalAction(type, displayName, commandId) {
|
|
|
1212
1194
|
constructor() {
|
|
1213
1195
|
super({
|
|
1214
1196
|
id: `workbench.action.chat.openNewChatSessionExternal.${type}`,
|
|
1215
|
-
title: ( localize2(
|
|
1197
|
+
title: ( localize2(6185, "New {0}", displayName)),
|
|
1216
1198
|
category: CHAT_CATEGORY,
|
|
1217
1199
|
f1: false,
|
|
1218
1200
|
precondition: ChatContextKeys.enabled
|
|
@@ -1255,7 +1237,7 @@ async function openChatSession(accessor, openOptions, chatSendOptions) {
|
|
|
1255
1237
|
override: ChatEditorInput.EditorID,
|
|
1256
1238
|
pinned: true,
|
|
1257
1239
|
title: {
|
|
1258
|
-
fallback: ( localize(
|
|
1240
|
+
fallback: ( localize(6186, "{0}", openOptions.displayName))
|
|
1259
1241
|
}
|
|
1260
1242
|
};
|
|
1261
1243
|
if (openOptions.replaceEditor) {
|
|
@@ -1315,9 +1297,6 @@ async function openChatSession(accessor, openOptions, chatSendOptions) {
|
|
|
1315
1297
|
}
|
|
1316
1298
|
}
|
|
1317
1299
|
function getResourceForNewChatSession(options) {
|
|
1318
|
-
if (options.chatResource) {
|
|
1319
|
-
return URI.revive(options.chatResource);
|
|
1320
|
-
}
|
|
1321
1300
|
const isRemoteSession = options.type !== AgentSessionProviders.Local;
|
|
1322
1301
|
if (isRemoteSession) {
|
|
1323
1302
|
return ( URI.from({
|
|
@@ -1329,7 +1308,7 @@ function getResourceForNewChatSession(options) {
|
|
|
1329
1308
|
if (isEditorPosition) {
|
|
1330
1309
|
return ChatEditorInput.getNewEditorUri();
|
|
1331
1310
|
}
|
|
1332
|
-
return LocalChatSessionUri.
|
|
1311
|
+
return LocalChatSessionUri.getNewSessionUri();
|
|
1333
1312
|
}
|
|
1334
1313
|
function isAgentSessionProviderType(type) {
|
|
1335
1314
|
return ( Object.values(AgentSessionProviders)).includes(type);
|