@codingame/monaco-vscode-katex-common 28.4.0 → 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
|
@@ -27,7 +27,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/sear
|
|
|
27
27
|
import { katexContainerClassName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/markdown/common/markedKatexExtension';
|
|
28
28
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
29
29
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
30
|
-
import {
|
|
30
|
+
import { ChatConfiguration, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
31
31
|
import { isRequestVM, isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
32
32
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
33
33
|
import { ChatAccessibilityProvider } from '../accessibility/chatAccessibilityProvider.js';
|
|
@@ -119,6 +119,16 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
119
119
|
this._getCurrentModeInfo = options.getCurrentModeInfo;
|
|
120
120
|
this._lastItemIdContextKey = ChatContextKeys.lastItemId.bindTo(this.contextKeyService);
|
|
121
121
|
this._container = container;
|
|
122
|
+
const updateInlineReferencesStyle = () => {
|
|
123
|
+
const style = this.configurationService.getValue(ChatConfiguration.InlineReferencesStyle);
|
|
124
|
+
this._container.classList.toggle("chat-inline-references-link-style", style === "link");
|
|
125
|
+
};
|
|
126
|
+
updateInlineReferencesStyle();
|
|
127
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
128
|
+
if (e.affectsConfiguration(ChatConfiguration.InlineReferencesStyle)) {
|
|
129
|
+
updateInlineReferencesStyle();
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
122
132
|
const scopedInstantiationService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.contextKeyService]))));
|
|
123
133
|
this._renderStyle = options.renderStyle;
|
|
124
134
|
const overflowWidgetsContainer = options.overflowWidgetsDomNode ?? createElement("div");
|
|
@@ -24,10 +24,12 @@ import { IChatLocationData, IChatSendRequestOptions } from "@codingame/monaco-vs
|
|
|
24
24
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
25
25
|
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
26
26
|
import { IChatSlashCommandService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatSlashCommands.service";
|
|
27
|
+
import { IChatArtifactsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service";
|
|
27
28
|
import { IChatTodoListService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatTodoListService.service";
|
|
28
29
|
import { ChatViewModel, IChatResponseViewModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel";
|
|
29
30
|
import { ChatAgentLocation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants";
|
|
30
31
|
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
32
|
+
import { IHandOff } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser";
|
|
31
33
|
import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
|
|
32
34
|
import { ChatTreeItem, IChatAcceptInputOptions, IChatCodeBlockInfo, IChatFileTreeInfo, IChatWidget, IChatWidgetViewContext, IChatWidgetViewModelChangeEvent, IChatWidgetViewOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
33
35
|
import { IChatAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
@@ -83,6 +85,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
83
85
|
private readonly chatSessionsService;
|
|
84
86
|
private readonly agentSessionsService;
|
|
85
87
|
private readonly chatTodoListService;
|
|
88
|
+
private readonly chatArtifactsService;
|
|
86
89
|
private readonly lifecycleService;
|
|
87
90
|
private readonly chatAttachmentResolveService;
|
|
88
91
|
private readonly chatTipService;
|
|
@@ -157,6 +160,8 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
157
160
|
private _isRenderingWelcome;
|
|
158
161
|
private _lockedAgent?;
|
|
159
162
|
private readonly _lockedToCodingAgentContextKey;
|
|
163
|
+
private readonly _lockedCodingAgentIdContextKey;
|
|
164
|
+
private readonly _chatSessionSupportsForkContextKey;
|
|
160
165
|
private readonly _agentSupportsAttachmentsContextKey;
|
|
161
166
|
private readonly _sessionIsEmptyContextKey;
|
|
162
167
|
private readonly _hasPendingRequestsContextKey;
|
|
@@ -176,7 +181,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
176
181
|
readonly viewContext: IChatWidgetViewContext;
|
|
177
182
|
get supportsChangingModes(): boolean;
|
|
178
183
|
get locationData(): IChatLocationData | undefined;
|
|
179
|
-
constructor(location: ChatAgentLocation | IChatWidgetLocationOptions, viewContext: IChatWidgetViewContext | undefined, viewOptions: IChatWidgetViewOptions, styles: IChatWidgetStyles, codeEditorService: ICodeEditorService, configurationService: IConfigurationService, dialogService: IDialogService, contextKeyService: IContextKeyService, instantiationService: IInstantiationService, chatService: IChatService, chatAgentService: IChatAgentService, chatWidgetService: IChatWidgetService, chatAccessibilityService: IChatAccessibilityService, logService: ILogService, themeService: IThemeService, chatSlashCommandService: IChatSlashCommandService, chatEditingService: IChatEditingService, telemetryService: ITelemetryService, promptsService: IPromptsService, toolsService: ILanguageModelToolsService, chatModeService: IChatModeService, chatLayoutService: IChatLayoutService, chatEntitlementService: IChatEntitlementService, chatSessionsService: IChatSessionsService, agentSessionsService: IAgentSessionsService, chatTodoListService: IChatTodoListService, lifecycleService: ILifecycleService, chatAttachmentResolveService: IChatAttachmentResolveService, chatTipService: IChatTipService, chatDebugService: IChatDebugService);
|
|
184
|
+
constructor(location: ChatAgentLocation | IChatWidgetLocationOptions, viewContext: IChatWidgetViewContext | undefined, viewOptions: IChatWidgetViewOptions, styles: IChatWidgetStyles, codeEditorService: ICodeEditorService, configurationService: IConfigurationService, dialogService: IDialogService, contextKeyService: IContextKeyService, instantiationService: IInstantiationService, chatService: IChatService, chatAgentService: IChatAgentService, chatWidgetService: IChatWidgetService, chatAccessibilityService: IChatAccessibilityService, logService: ILogService, themeService: IThemeService, chatSlashCommandService: IChatSlashCommandService, chatEditingService: IChatEditingService, telemetryService: ITelemetryService, promptsService: IPromptsService, toolsService: ILanguageModelToolsService, chatModeService: IChatModeService, chatLayoutService: IChatLayoutService, chatEntitlementService: IChatEntitlementService, chatSessionsService: IChatSessionsService, agentSessionsService: IAgentSessionsService, chatTodoListService: IChatTodoListService, chatArtifactsService: IChatArtifactsService, lifecycleService: ILifecycleService, chatAttachmentResolveService: IChatAttachmentResolveService, chatTipService: IChatTipService, chatDebugService: IChatDebugService);
|
|
180
185
|
private _lastSelectedAgent;
|
|
181
186
|
set lastSelectedAgent(agent: IChatAgentData | undefined);
|
|
182
187
|
get lastSelectedAgent(): IChatAgentData | undefined;
|
|
@@ -234,6 +239,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
234
239
|
private renderFollowups;
|
|
235
240
|
private renderChatSuggestNextWidget;
|
|
236
241
|
private handleNextPromptSelection;
|
|
242
|
+
executeHandoff(handoff: IHandOff, agentId?: string): Promise<void>;
|
|
237
243
|
handleDelegationExitIfNeeded(sourceAgent: Pick<IChatAgentData, "id" | "name"> | undefined, targetAgent: IChatAgentData | undefined): Promise<void>;
|
|
238
244
|
private _shouldExitAfterDelegation;
|
|
239
245
|
/**
|
|
@@ -267,6 +273,8 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
267
273
|
logInputHistory(): void;
|
|
268
274
|
acceptInput(query?: string, options?: IChatAcceptInputOptions): Promise<IChatResponseModel | undefined>;
|
|
269
275
|
rerunLastRequest(): Promise<void>;
|
|
276
|
+
private getConfiguredThinkingStyle;
|
|
277
|
+
private logThinkingStyleUsage;
|
|
270
278
|
private _applyPromptFileIfSet;
|
|
271
279
|
private _acceptInput;
|
|
272
280
|
private _resolveDirectoryImageAttachments;
|
|
@@ -20,7 +20,7 @@ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/netw
|
|
|
20
20
|
import { IsSessionsWindowContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
21
21
|
import { filter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
22
22
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
23
|
-
import { isEqual, extUri
|
|
23
|
+
import { isEqual, extUri } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
24
24
|
import { MicrotaskDelay } from '@codingame/monaco-vscode-api/vscode/vs/base/common/symbols';
|
|
25
25
|
import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
26
26
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -56,11 +56,12 @@ import { ChatRequestQueueKind, ChatSendResult } from '@codingame/monaco-vscode-a
|
|
|
56
56
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
57
57
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
58
58
|
import { IChatSlashCommandService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatSlashCommands.service';
|
|
59
|
+
import { IChatArtifactsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service';
|
|
59
60
|
import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/chatTodoListService.service';
|
|
60
61
|
import { isWorkspaceVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, toPromptFileVariableEntry, PromptFileVariableKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
61
62
|
import { isResponseVM, isRequestVM, ChatViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
62
63
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
63
|
-
import { ChatModeKind, ChatConfiguration,
|
|
64
|
+
import { ChatModeKind, ChatPermissionLevel, ChatConfiguration, ThinkingDisplayMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
64
65
|
import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
65
66
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
66
67
|
import { ComputeAutomaticInstructions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
|
|
@@ -111,7 +112,7 @@ const supportsAllAttachments = {
|
|
|
111
112
|
supportsPromptAttachments: true,
|
|
112
113
|
supportsHandOffs: true
|
|
113
114
|
};
|
|
114
|
-
const DISCLAIMER = ( localize(
|
|
115
|
+
const DISCLAIMER = ( localize(6962, "AI responses may be inaccurate"));
|
|
115
116
|
let ChatWidget = class ChatWidget extends Disposable {
|
|
116
117
|
static {
|
|
117
118
|
ChatWidget_1 = this;
|
|
@@ -212,6 +213,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
212
213
|
chatSessionsService,
|
|
213
214
|
agentSessionsService,
|
|
214
215
|
chatTodoListService,
|
|
216
|
+
chatArtifactsService,
|
|
215
217
|
lifecycleService,
|
|
216
218
|
chatAttachmentResolveService,
|
|
217
219
|
chatTipService,
|
|
@@ -241,6 +243,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
241
243
|
this.chatSessionsService = chatSessionsService;
|
|
242
244
|
this.agentSessionsService = agentSessionsService;
|
|
243
245
|
this.chatTodoListService = chatTodoListService;
|
|
246
|
+
this.chatArtifactsService = chatArtifactsService;
|
|
244
247
|
this.lifecycleService = lifecycleService;
|
|
245
248
|
this.chatAttachmentResolveService = chatAttachmentResolveService;
|
|
246
249
|
this.chatTipService = chatTipService;
|
|
@@ -289,6 +292,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
289
292
|
this._editingSession = observableValue(this, undefined);
|
|
290
293
|
this._viewModelObs = observableFromEvent(this, this.onDidChangeViewModel, () => this.viewModel);
|
|
291
294
|
this._lockedToCodingAgentContextKey = ChatContextKeys.lockedToCodingAgent.bindTo(this.contextKeyService);
|
|
295
|
+
this._lockedCodingAgentIdContextKey = ChatContextKeys.lockedCodingAgentId.bindTo(this.contextKeyService);
|
|
296
|
+
this._chatSessionSupportsForkContextKey = ChatContextKeys.chatSessionSupportsFork.bindTo(this.contextKeyService);
|
|
292
297
|
this._agentSupportsAttachmentsContextKey = ChatContextKeys.agentSupportsAttachments.bindTo(this.contextKeyService);
|
|
293
298
|
this._sessionIsEmptyContextKey = ChatContextKeys.chatSessionIsEmpty.bindTo(this.contextKeyService);
|
|
294
299
|
this._hasPendingRequestsContextKey = ChatContextKeys.hasPendingRequests.bindTo(this.contextKeyService);
|
|
@@ -473,6 +478,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
473
478
|
this.inputPart.renderChatTodoListWidget(sessionResource);
|
|
474
479
|
}
|
|
475
480
|
}));
|
|
481
|
+
this._register(this.chatArtifactsService.onDidUpdateArtifacts(sessionResource => {
|
|
482
|
+
if (isEqual(this.viewModel?.sessionResource, sessionResource)) {
|
|
483
|
+
this.inputPart.renderArtifactsWidget(sessionResource);
|
|
484
|
+
}
|
|
485
|
+
}));
|
|
476
486
|
}
|
|
477
487
|
set lastSelectedAgent(agent) {
|
|
478
488
|
this.parsedChatRequest = undefined;
|
|
@@ -547,10 +557,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
547
557
|
this._register(this.chatSuggestNextWidget.onDidSelectPrompt((
|
|
548
558
|
{
|
|
549
559
|
handoff,
|
|
550
|
-
agentId
|
|
560
|
+
agentId,
|
|
561
|
+
withAutopilot
|
|
551
562
|
}
|
|
552
563
|
) => {
|
|
553
|
-
this.handleNextPromptSelection(handoff, agentId);
|
|
564
|
+
this.handleNextPromptSelection(handoff, agentId, withAutopilot);
|
|
554
565
|
}));
|
|
555
566
|
if (renderInputOnTop) {
|
|
556
567
|
this.createInput(this.container, {
|
|
@@ -816,7 +827,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
816
827
|
if (this.chatEntitlementService.anonymous && !this.chatEntitlementService.sentiment.installed) {
|
|
817
828
|
const providers = product.defaultChatAgent.provider;
|
|
818
829
|
additionalMessage = ( new MarkdownString(( localize(
|
|
819
|
-
|
|
830
|
+
6963,
|
|
820
831
|
"By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3}).",
|
|
821
832
|
providers.default.name,
|
|
822
833
|
providers.default.name,
|
|
@@ -870,7 +881,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
870
881
|
const tipPart = store.add(
|
|
871
882
|
this.instantiationService.createInstance(ChatTipContentPart, tip, renderer)
|
|
872
883
|
);
|
|
873
|
-
tipContainer.appendChild(tipPart.domNode);
|
|
874
884
|
this._gettingStartedTipPartRef = tipPart;
|
|
875
885
|
store.add(tipPart.onDidHide(() => {
|
|
876
886
|
tipPart.domNode.remove();
|
|
@@ -880,6 +890,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
880
890
|
this.focusInput();
|
|
881
891
|
}));
|
|
882
892
|
this._gettingStartedTipPart.value = store;
|
|
893
|
+
clearNode(tipContainer);
|
|
894
|
+
tipContainer.appendChild(tipPart.domNode);
|
|
883
895
|
setVisibility(true, tipContainer);
|
|
884
896
|
}
|
|
885
897
|
_getGenerateInstructionsMessage() {
|
|
@@ -897,7 +909,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
897
909
|
return ( new MarkdownString(""));
|
|
898
910
|
} else if (this._instructionFilesExist === false) {
|
|
899
911
|
return (new MarkdownString(localize(
|
|
900
|
-
|
|
912
|
+
6964,
|
|
901
913
|
"[Generate Agent Instructions]({0}) to onboard AI onto your codebase.",
|
|
902
914
|
`command:${GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID}`
|
|
903
915
|
), {
|
|
@@ -918,23 +930,24 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
918
930
|
}
|
|
919
931
|
getWelcomeViewContent(additionalMessage) {
|
|
920
932
|
if (this.isLockedToCodingAgent) {
|
|
921
|
-
const
|
|
922
|
-
const
|
|
923
|
-
const
|
|
933
|
+
const contribution = this._lockedAgent ? this.chatSessionsService.getChatSessionContribution(this._lockedAgent.id) : undefined;
|
|
934
|
+
const providerIcon = contribution?.icon;
|
|
935
|
+
const providerTitle = contribution?.welcomeTitle;
|
|
936
|
+
const providerMessage = contribution?.welcomeMessage;
|
|
924
937
|
const message = providerMessage ? ( new MarkdownString(providerMessage)) : (this._lockedAgent?.prefix === "@copilot " ? ( new MarkdownString(( localize(
|
|
925
|
-
|
|
938
|
+
6965,
|
|
926
939
|
"This chat session will be forwarded to the {0} [coding agent]({1}) where work is completed in the background. ",
|
|
927
940
|
this._lockedAgent.prefix,
|
|
928
941
|
"https://aka.ms/coding-agent-docs"
|
|
929
942
|
)) + DISCLAIMER, {
|
|
930
943
|
isTrusted: true
|
|
931
944
|
})) : ( new MarkdownString(( localize(
|
|
932
|
-
|
|
945
|
+
6966,
|
|
933
946
|
"This chat session will be forwarded to the {0} coding agent where work is completed in the background. ",
|
|
934
947
|
this._lockedAgent?.prefix
|
|
935
948
|
)) + DISCLAIMER)));
|
|
936
949
|
return {
|
|
937
|
-
title: providerTitle ?? ( localize(
|
|
950
|
+
title: providerTitle ?? ( localize(6967, "Delegate to {0}", this._lockedAgent?.prefix)),
|
|
938
951
|
message,
|
|
939
952
|
icon: providerIcon ?? Codicon.sendToRemoteAgent,
|
|
940
953
|
additionalMessage,
|
|
@@ -943,11 +956,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
943
956
|
}
|
|
944
957
|
let title;
|
|
945
958
|
if (this.input.currentModeKind === ChatModeKind.Ask) {
|
|
946
|
-
title = ( localize(
|
|
959
|
+
title = ( localize(6968, "Ask about your code"));
|
|
947
960
|
} else if (this.input.currentModeKind === ChatModeKind.Edit) {
|
|
948
|
-
title = ( localize(
|
|
961
|
+
title = ( localize(6969, "Edit in context"));
|
|
949
962
|
} else {
|
|
950
|
-
title = ( localize(
|
|
963
|
+
title = ( localize(6970, "Build with Agent"));
|
|
951
964
|
}
|
|
952
965
|
return {
|
|
953
966
|
title,
|
|
@@ -984,18 +997,34 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
984
997
|
}
|
|
985
998
|
const lastItem = items[items.length - 1];
|
|
986
999
|
const lastResponseComplete = lastItem && isResponseVM(lastItem) && lastItem.isComplete;
|
|
987
|
-
if (!lastResponseComplete) {
|
|
1000
|
+
if (!lastResponseComplete || lastItem.isCanceled) {
|
|
1001
|
+
this.chatSuggestNextWidget.hide();
|
|
988
1002
|
return;
|
|
989
1003
|
}
|
|
990
|
-
const
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
1004
|
+
const modeInfo = lastItem.model.request?.modeInfo;
|
|
1005
|
+
let responseMode;
|
|
1006
|
+
if (modeInfo?.modeInstructions?.name) {
|
|
1007
|
+
responseMode = this.chatModeService.findModeByName(modeInfo.modeInstructions.name);
|
|
1008
|
+
} else if (modeInfo?.modeId) {
|
|
1009
|
+
responseMode = this.chatModeService.findModeById(modeInfo.modeId);
|
|
1010
|
+
} else {
|
|
1011
|
+
responseMode = this.input.currentModeObs.get();
|
|
1012
|
+
}
|
|
1013
|
+
const handoffs = responseMode?.handOffs?.get();
|
|
1014
|
+
if (responseMode && handoffs && handoffs.length > 0) {
|
|
1015
|
+
const permissionLevel = this.inputPart.currentModeInfo.permissionLevel;
|
|
1016
|
+
if (permissionLevel === ChatPermissionLevel.Autopilot) {
|
|
1017
|
+
const autoSendHandoff = handoffs.find(h => h.send);
|
|
1018
|
+
if (autoSendHandoff) {
|
|
1019
|
+
this.handleNextPromptSelection(autoSendHandoff);
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
994
1023
|
const wasHidden = this.chatSuggestNextWidget.domNode.style.display === "none";
|
|
995
|
-
this.chatSuggestNextWidget.render(
|
|
1024
|
+
this.chatSuggestNextWidget.render(responseMode);
|
|
996
1025
|
if (wasHidden) {
|
|
997
1026
|
this.telemetryService.publicLog2("chat.handoffWidgetShown", {
|
|
998
|
-
agent: getModeNameForTelemetry(
|
|
1027
|
+
agent: getModeNameForTelemetry(responseMode),
|
|
999
1028
|
handoffCount: handoffs.length
|
|
1000
1029
|
});
|
|
1001
1030
|
}
|
|
@@ -1006,8 +1035,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1006
1035
|
this.layout(this.bodyDimension.height, this.bodyDimension.width);
|
|
1007
1036
|
}
|
|
1008
1037
|
}
|
|
1009
|
-
handleNextPromptSelection(handoff, agentId) {
|
|
1038
|
+
handleNextPromptSelection(handoff, agentId, withAutopilot) {
|
|
1010
1039
|
this.chatSuggestNextWidget.hide();
|
|
1040
|
+
if (withAutopilot) {
|
|
1041
|
+
this.inputPart.setPermissionLevel(ChatPermissionLevel.Autopilot);
|
|
1042
|
+
}
|
|
1011
1043
|
const promptToUse = handoff.prompt;
|
|
1012
1044
|
const currentMode = this.input.currentModeObs.get();
|
|
1013
1045
|
const toMode = handoff.agent ? this.chatModeService.findModeByName(handoff.agent) : undefined;
|
|
@@ -1017,10 +1049,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1017
1049
|
hasPrompt: Boolean(promptToUse),
|
|
1018
1050
|
autoSend: Boolean(handoff.send)
|
|
1019
1051
|
});
|
|
1052
|
+
this.executeHandoff(handoff, agentId).catch(e => {
|
|
1053
|
+
const target = agentId ?? handoff.agent ?? "unknown";
|
|
1054
|
+
this.logService.error(`[Handoff] Failed to execute handoff '${handoff.label}' to '${target}'`, e);
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
async executeHandoff(handoff, agentId) {
|
|
1058
|
+
this.chatSuggestNextWidget.hide();
|
|
1059
|
+
const promptToUse = handoff.prompt;
|
|
1020
1060
|
if (agentId) {
|
|
1021
1061
|
this.input.setValue(`@${agentId} ${promptToUse}`, false);
|
|
1022
1062
|
this.input.focus();
|
|
1023
|
-
this.acceptInput().catch(
|
|
1063
|
+
this.acceptInput().catch(
|
|
1064
|
+
e => this.logService.error(`[Handoff] Failed to submit delegated handoff to '@${agentId}'`, e)
|
|
1065
|
+
);
|
|
1024
1066
|
} else if (handoff.agent) {
|
|
1025
1067
|
this._switchToAgentByName(handoff.agent);
|
|
1026
1068
|
if (handoff.model) {
|
|
@@ -1273,7 +1315,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1273
1315
|
if (item?.contextKeyService) {
|
|
1274
1316
|
ChatContextKeys.currentlyEditing.bindTo(item.contextKeyService).set(true);
|
|
1275
1317
|
}
|
|
1276
|
-
const isEditingSentRequest = currentElement.pendingKind === undefined ? ChatContextKeys.EditingRequestType.Sent : ChatContextKeys.EditingRequestType.
|
|
1318
|
+
const isEditingSentRequest = currentElement.pendingKind === undefined ? ChatContextKeys.EditingRequestType.Sent : currentElement.pendingKind === ChatRequestQueueKind.Queued ? ChatContextKeys.EditingRequestType.Queue : ChatContextKeys.EditingRequestType.Steer;
|
|
1277
1319
|
const isInput = this.configurationService.getValue("chat.editRequests") === "input";
|
|
1278
1320
|
this.inputPart?.setEditing(!!this.viewModel?.editing && isInput, isEditingSentRequest);
|
|
1279
1321
|
if (!isInput) {
|
|
@@ -1583,9 +1625,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1583
1625
|
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1584
1626
|
this.listWidget.setViewModel(this.viewModel);
|
|
1585
1627
|
if (this._lockedAgent) {
|
|
1586
|
-
let placeholder = this.chatSessionsService.
|
|
1628
|
+
let placeholder = this.chatSessionsService.getChatSessionContribution(this._lockedAgent.id)?.inputPlaceholder;
|
|
1587
1629
|
if (!placeholder) {
|
|
1588
|
-
placeholder = ( localize(
|
|
1630
|
+
placeholder = ( localize(
|
|
1631
|
+
6971,
|
|
1632
|
+
"Chat with {0}",
|
|
1633
|
+
this._lockedAgent.displayName || this._lockedAgent.name
|
|
1634
|
+
));
|
|
1589
1635
|
}
|
|
1590
1636
|
this.viewModel.setInputPlaceholder(placeholder);
|
|
1591
1637
|
this.inputEditor.updateOptions({
|
|
@@ -1623,6 +1669,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1623
1669
|
this.onDidChangeItems();
|
|
1624
1670
|
}));
|
|
1625
1671
|
this._sessionIsEmptyContextKey.set(model.getRequests().length === 0);
|
|
1672
|
+
const supportsFork = this.chatSessionsService.sessionSupportsFork(model.sessionResource);
|
|
1673
|
+
this._chatSessionSupportsForkContextKey.set(supportsFork);
|
|
1674
|
+
this.listWidget?.updateRendererOptions({
|
|
1675
|
+
supportsFork
|
|
1676
|
+
});
|
|
1626
1677
|
this._sessionHasDebugDataContextKey.set(this.chatDebugService.getEvents(model.sessionResource).length > 0);
|
|
1627
1678
|
let lastSteeringCount = 0;
|
|
1628
1679
|
const updatePendingRequestKeys = announceSteering => {
|
|
@@ -1631,7 +1682,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1631
1682
|
this._hasPendingRequestsContextKey.set(pendingCount > 0);
|
|
1632
1683
|
const steeringCount = pendingRequests.filter(pending => pending.kind === ChatRequestQueueKind.Steering).length;
|
|
1633
1684
|
if (announceSteering && steeringCount > 0 && lastSteeringCount === 0) {
|
|
1634
|
-
status(( localize(
|
|
1685
|
+
status(( localize(6972, "Steering")));
|
|
1635
1686
|
}
|
|
1636
1687
|
lastSteeringCount = steeringCount;
|
|
1637
1688
|
};
|
|
@@ -1649,6 +1700,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1649
1700
|
if (e.kind === "addRequest") {
|
|
1650
1701
|
this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, false);
|
|
1651
1702
|
this._sessionIsEmptyContextKey.set(false);
|
|
1703
|
+
this.chatSuggestNextWidget.hide();
|
|
1652
1704
|
}
|
|
1653
1705
|
if (e.kind === "removeRequest") {
|
|
1654
1706
|
this.inputPart.clearTodoListWidget(this.viewModel?.sessionResource, true);
|
|
@@ -1671,8 +1723,10 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1671
1723
|
this.onDidChangeItems();
|
|
1672
1724
|
this.listWidget.scrollToEnd();
|
|
1673
1725
|
}
|
|
1726
|
+
this.renderChatSuggestNextWidget();
|
|
1674
1727
|
this.updateChatInputContext();
|
|
1675
1728
|
this.input.renderChatTodoListWidget(this.viewModel.sessionResource);
|
|
1729
|
+
this.input.renderArtifactsWidget(this.viewModel.sessionResource);
|
|
1676
1730
|
}
|
|
1677
1731
|
getFocus() {
|
|
1678
1732
|
return this.listWidget.getFocus()[0] ?? undefined;
|
|
@@ -1710,6 +1764,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1710
1764
|
displayName
|
|
1711
1765
|
};
|
|
1712
1766
|
this._lockedToCodingAgentContextKey.set(true);
|
|
1767
|
+
this._lockedCodingAgentIdContextKey.set(agentId);
|
|
1713
1768
|
this.renderWelcomeViewContentIfNeeded();
|
|
1714
1769
|
const agent = this.chatAgentService.getAgent(agentId);
|
|
1715
1770
|
this._updateAgentCapabilitiesContextKeys(agent);
|
|
@@ -1726,6 +1781,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1726
1781
|
unlockFromCodingAgent() {
|
|
1727
1782
|
this._lockedAgent = undefined;
|
|
1728
1783
|
this._lockedToCodingAgentContextKey.set(false);
|
|
1784
|
+
this._lockedCodingAgentIdContextKey.set("");
|
|
1785
|
+
this._chatSessionSupportsForkContextKey.set(false);
|
|
1729
1786
|
this._updateAgentCapabilitiesContextKeys(undefined);
|
|
1730
1787
|
this.renderWelcomeViewContentIfNeeded();
|
|
1731
1788
|
if (this.viewModel) {
|
|
@@ -1773,7 +1830,27 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1773
1830
|
userSelectedModelId: this.input.currentLanguageModel,
|
|
1774
1831
|
modeInfo: this.input.currentModeInfo
|
|
1775
1832
|
};
|
|
1776
|
-
|
|
1833
|
+
const result = await this.chatService.resendRequest(lastRequest, options);
|
|
1834
|
+
this.logThinkingStyleUsage("rerun");
|
|
1835
|
+
return result;
|
|
1836
|
+
}
|
|
1837
|
+
getConfiguredThinkingStyle() {
|
|
1838
|
+
const thinkingStyle = this.configurationService.getValue(ChatConfiguration.ThinkingStyle);
|
|
1839
|
+
switch (thinkingStyle) {
|
|
1840
|
+
case ThinkingDisplayMode.Collapsed:
|
|
1841
|
+
case ThinkingDisplayMode.CollapsedPreview:
|
|
1842
|
+
case ThinkingDisplayMode.FixedScrolling:
|
|
1843
|
+
return thinkingStyle;
|
|
1844
|
+
default:
|
|
1845
|
+
return ThinkingDisplayMode.FixedScrolling;
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1848
|
+
logThinkingStyleUsage(requestKind) {
|
|
1849
|
+
this.telemetryService.publicLog2("chat.thinkingStyleUsage", {
|
|
1850
|
+
thinkingStyle: this.getConfiguredThinkingStyle(),
|
|
1851
|
+
location: this.location,
|
|
1852
|
+
requestKind
|
|
1853
|
+
});
|
|
1777
1854
|
}
|
|
1778
1855
|
async _applyPromptFileIfSet(requestInput) {
|
|
1779
1856
|
const agentSlashPromptPart = this.parsedInput.parts.find(r => r instanceof ChatRequestSlashPromptPart);
|
|
@@ -1803,7 +1880,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1803
1880
|
true,
|
|
1804
1881
|
toolReferences
|
|
1805
1882
|
));
|
|
1806
|
-
requestInput.input = ( this.parsedInput.parts.filter(part => !(part instanceof ChatRequestSlashPromptPart)).map(part => part.text)).join("").trim();
|
|
1807
1883
|
const promptPath = slashCommand.promptPath;
|
|
1808
1884
|
const promptRunEvent = {
|
|
1809
1885
|
storage: promptPath.storage
|
|
@@ -1815,11 +1891,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1815
1891
|
promptRunEvent.promptNameHash = ( hash(slashCommand.name).toString(16));
|
|
1816
1892
|
}
|
|
1817
1893
|
this.telemetryService.publicLog2("chat.promptRun", promptRunEvent);
|
|
1818
|
-
const input = requestInput.input.trim();
|
|
1819
|
-
requestInput.input = `Follow instructions in [${basename(parseResult.uri)}](${( parseResult.uri.toString())}).`;
|
|
1820
|
-
if (input) {
|
|
1821
|
-
requestInput.input += `\n${input}`;
|
|
1822
|
-
}
|
|
1823
1894
|
if (parseResult.header) {
|
|
1824
1895
|
await this._applyPromptMetadata(parseResult.header, requestInput);
|
|
1825
1896
|
}
|
|
@@ -1864,7 +1935,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1864
1935
|
this.chatService.removePendingRequest(this.viewModel.sessionResource, editingRequestId);
|
|
1865
1936
|
options.queue ??= editingPendingRequest;
|
|
1866
1937
|
} else {
|
|
1867
|
-
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-editing");
|
|
1938
|
+
await this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-editing");
|
|
1868
1939
|
options.queue = undefined;
|
|
1869
1940
|
}
|
|
1870
1941
|
this.finishedEditing(true);
|
|
@@ -1872,17 +1943,14 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1872
1943
|
}
|
|
1873
1944
|
const model = this.viewModel.model;
|
|
1874
1945
|
const requestInProgress = model.requestInProgress.get();
|
|
1875
|
-
if (options.alwaysQueue) {
|
|
1876
|
-
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1877
|
-
}
|
|
1878
1946
|
if (model.requestNeedsInput.get() && !model.getPendingRequests().length) {
|
|
1879
|
-
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-needsInput");
|
|
1947
|
+
await this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-needsInput");
|
|
1880
1948
|
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1881
1949
|
}
|
|
1882
1950
|
if (requestInProgress) {
|
|
1883
1951
|
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1884
1952
|
}
|
|
1885
|
-
if (!
|
|
1953
|
+
if (!requestInProgress && !isEditing && !(await this.confirmPendingRequestsBeforeSend(model, options))) {
|
|
1886
1954
|
return;
|
|
1887
1955
|
}
|
|
1888
1956
|
await this._applyPromptFileIfSet(requestInputs);
|
|
@@ -1935,12 +2003,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1935
2003
|
...this.getModeRequestOptions(),
|
|
1936
2004
|
modeInfo: this.input.currentModeInfo,
|
|
1937
2005
|
agentIdSilent: this._lockedAgent?.id,
|
|
1938
|
-
queue: options?.queue
|
|
1939
|
-
pauseQueue: options?.alwaysQueue
|
|
2006
|
+
queue: options?.queue
|
|
1940
2007
|
});
|
|
1941
2008
|
if (ChatSendResult.isRejected(result)) {
|
|
1942
2009
|
return;
|
|
1943
2010
|
}
|
|
2011
|
+
this.logThinkingStyleUsage("submit");
|
|
1944
2012
|
this.updateChatViewVisibility();
|
|
1945
2013
|
this.input.acceptInput(options?.storeToHistory ?? isUserQuery);
|
|
1946
2014
|
const sent = ChatSendResult.isQueued(result) ? await result.deferred : result;
|
|
@@ -1952,6 +2020,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1952
2020
|
slashCommand: sent.data.slashCommand
|
|
1953
2021
|
});
|
|
1954
2022
|
this.handleDelegationExitIfNeeded(this._lockedAgent, sent.data.agent);
|
|
2023
|
+
if (sent.newSessionResource) {
|
|
2024
|
+
const newModel = this.chatService.getSession(sent.newSessionResource);
|
|
2025
|
+
if (newModel) {
|
|
2026
|
+
this.setModel(newModel);
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
1955
2029
|
sent.data.responseCreatedPromise.then(() => {
|
|
1956
2030
|
this.chatAccessibilityService.acceptRequest(submittedSessionResource);
|
|
1957
2031
|
sent.data.responseCompletePromise.then(() => {
|
|
@@ -2002,16 +2076,16 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2002
2076
|
}
|
|
2003
2077
|
const promptResult = await this.dialogService.prompt({
|
|
2004
2078
|
type: "question",
|
|
2005
|
-
message: ( localize(
|
|
2079
|
+
message: ( localize(6973, "You already have pending requests.")),
|
|
2006
2080
|
detail: ( localize(
|
|
2007
|
-
|
|
2081
|
+
6974,
|
|
2008
2082
|
"Do you want to keep them in the queue or remove them before sending this message?"
|
|
2009
2083
|
)),
|
|
2010
2084
|
buttons: [{
|
|
2011
|
-
label: ( localize(
|
|
2085
|
+
label: ( localize(6975, "Keep Pending Requests")),
|
|
2012
2086
|
run: () => "keep"
|
|
2013
2087
|
}, {
|
|
2014
|
-
label: ( localize(
|
|
2088
|
+
label: ( localize(6976, "Remove Pending Requests")),
|
|
2015
2089
|
run: () => "remove"
|
|
2016
2090
|
}],
|
|
2017
2091
|
cancelButton: true
|
|
@@ -2028,11 +2102,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2028
2102
|
}
|
|
2029
2103
|
getModeRequestOptions() {
|
|
2030
2104
|
const sessionResource = this.viewModel?.sessionResource;
|
|
2105
|
+
const capturedModeId = this.input.currentModeObs.get().id;
|
|
2031
2106
|
const userSelectedTools = this.input.selectedToolsModel.userSelectedTools;
|
|
2032
2107
|
let lastToolsSnapshot = userSelectedTools.get();
|
|
2033
2108
|
const scopedTools = derived(reader => {
|
|
2034
2109
|
const activeSession = this._viewModelObs.read(reader)?.sessionResource;
|
|
2035
|
-
|
|
2110
|
+
const currentModeId = this.input.currentModeObs.read(reader).id;
|
|
2111
|
+
if (isEqual(activeSession, sessionResource) && currentModeId === capturedModeId) {
|
|
2036
2112
|
const tools = userSelectedTools.read(reader);
|
|
2037
2113
|
lastToolsSnapshot = tools;
|
|
2038
2114
|
return tools;
|
|
@@ -2226,7 +2302,16 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2226
2302
|
attachedContext
|
|
2227
2303
|
}
|
|
2228
2304
|
) {
|
|
2229
|
-
this.
|
|
2305
|
+
const contribution = this._lockedAgent ? this.chatSessionsService.getChatSessionContribution(this._lockedAgent.id) : undefined;
|
|
2306
|
+
const isContributedSession = !!contribution;
|
|
2307
|
+
const autoAttachEnabled = isContributedSession ? contribution.autoAttachReferences === true : true;
|
|
2308
|
+
if (!autoAttachEnabled) {
|
|
2309
|
+
this.logService.debug(
|
|
2310
|
+
`ChatWidget#_autoAttachInstructions: skipped, autoAttachReferences is disabled`
|
|
2311
|
+
);
|
|
2312
|
+
return;
|
|
2313
|
+
}
|
|
2314
|
+
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are enabled`);
|
|
2230
2315
|
const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
|
|
2231
2316
|
const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
|
|
2232
2317
|
const sessionResource = this._viewModel?.model.sessionResource;
|
|
@@ -2243,6 +2328,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2243
2328
|
this.listWidget.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
2244
2329
|
}
|
|
2245
2330
|
};
|
|
2246
|
-
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IConfigurationService)), ( __param(6, IDialogService)), ( __param(7, IContextKeyService)), ( __param(8, IInstantiationService)), ( __param(9, IChatService)), ( __param(10, IChatAgentService)), ( __param(11, IChatWidgetService)), ( __param(12, IChatAccessibilityService)), ( __param(13, ILogService)), ( __param(14, IThemeService)), ( __param(15, IChatSlashCommandService)), ( __param(16, IChatEditingService)), ( __param(17, ITelemetryService)), ( __param(18, IPromptsService)), ( __param(19, ILanguageModelToolsService)), ( __param(20, IChatModeService)), ( __param(21, IChatLayoutService)), ( __param(22, IChatEntitlementService)), ( __param(23, IChatSessionsService)), ( __param(24, IAgentSessionsService)), ( __param(25, IChatTodoListService)), ( __param(26,
|
|
2331
|
+
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IConfigurationService)), ( __param(6, IDialogService)), ( __param(7, IContextKeyService)), ( __param(8, IInstantiationService)), ( __param(9, IChatService)), ( __param(10, IChatAgentService)), ( __param(11, IChatWidgetService)), ( __param(12, IChatAccessibilityService)), ( __param(13, ILogService)), ( __param(14, IThemeService)), ( __param(15, IChatSlashCommandService)), ( __param(16, IChatEditingService)), ( __param(17, ITelemetryService)), ( __param(18, IPromptsService)), ( __param(19, ILanguageModelToolsService)), ( __param(20, IChatModeService)), ( __param(21, IChatLayoutService)), ( __param(22, IChatEntitlementService)), ( __param(23, IChatSessionsService)), ( __param(24, IAgentSessionsService)), ( __param(25, IChatTodoListService)), ( __param(26, IChatArtifactsService)), ( __param(27, ILifecycleService)), ( __param(28, IChatAttachmentResolveService)), ( __param(29, IChatTipService)), ( __param(30, IChatDebugService))], ChatWidget));
|
|
2247
2332
|
|
|
2248
2333
|
export { ChatWidget, isQuickChat };
|
|
@@ -45,7 +45,7 @@ let ChatFollowups = class ChatFollowups extends Disposable {
|
|
|
45
45
|
} else if (followup.kind === "command") {
|
|
46
46
|
button.element.classList.add("interactive-followup-command");
|
|
47
47
|
}
|
|
48
|
-
button.element.ariaLabel = ( localize(
|
|
48
|
+
button.element.ariaLabel = ( localize(6977, "Follow up question: {0}", baseTitle));
|
|
49
49
|
button.label = ( new MarkdownString(baseTitle));
|
|
50
50
|
this._register(button.onDidClick(() => this.clickHandler(followup)));
|
|
51
51
|
}
|
|
@@ -136,6 +136,7 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
136
136
|
private _workingSetCollapsed;
|
|
137
137
|
private _stableInputPartWidth;
|
|
138
138
|
private readonly _chatInputTodoListWidget;
|
|
139
|
+
private readonly _chatArtifactsWidget;
|
|
139
140
|
private readonly _chatQuestionCarouselWidgets;
|
|
140
141
|
private readonly _questionCarouselResponseIds;
|
|
141
142
|
private readonly _questionCarouselSessionResources;
|
|
@@ -190,6 +191,7 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
190
191
|
private readonly attachedContextDisposables;
|
|
191
192
|
private chatEditingSessionWidgetContainer;
|
|
192
193
|
private chatInputTodoListWidgetContainer;
|
|
194
|
+
private chatArtifactsWidgetContainer;
|
|
193
195
|
private chatGettingStartedTipContainer;
|
|
194
196
|
private chatQuestionCarouselContainer;
|
|
195
197
|
private chatInputWidgetsContainer;
|
|
@@ -203,6 +205,7 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
203
205
|
readonly height: ISettableObservable<number, void>;
|
|
204
206
|
private _inputEditor;
|
|
205
207
|
private _inputEditorElement;
|
|
208
|
+
private _forceVisibleScrollbarUntilAccept;
|
|
206
209
|
private _inputModel;
|
|
207
210
|
private readonly _modelSyncDisposables;
|
|
208
211
|
private _isSyncingToOrFromInputModel;
|
|
@@ -228,6 +231,7 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
228
231
|
private chatSessionHasOptions;
|
|
229
232
|
private chatSessionOptionsValid;
|
|
230
233
|
private agentSessionTypeKey;
|
|
234
|
+
private chatSessionSupportsDelegationKey;
|
|
231
235
|
private chatSessionHasCustomAgentTarget;
|
|
232
236
|
private chatSessionHasTargetedModels;
|
|
233
237
|
private modelWidget;
|
|
@@ -238,6 +242,7 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
238
242
|
private chatSessionPickerWidgets;
|
|
239
243
|
private chatSessionPickerContainer;
|
|
240
244
|
private _lastSessionPickerAction;
|
|
245
|
+
private _lastSessionPickerOptions;
|
|
241
246
|
private readonly _waitForPersistedLanguageModel;
|
|
242
247
|
private readonly _chatSessionOptionEmitters;
|
|
243
248
|
/**
|
|
@@ -472,6 +477,8 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
472
477
|
private handleAttachmentNavigation;
|
|
473
478
|
renderChatTodoListWidget(chatSessionResource: URI): Promise<void>;
|
|
474
479
|
clearTodoListWidget(sessionResource: URI | undefined, force: boolean): void;
|
|
480
|
+
renderArtifactsWidget(chatSessionResource: URI): void;
|
|
481
|
+
clearArtifactsWidget(): void;
|
|
475
482
|
renderQuestionCarousel(carousel: IChatQuestionCarousel, context: IChatContentPartRenderContext, options: IChatQuestionCarouselOptions): ChatQuestionCarouselPart;
|
|
476
483
|
clearQuestionCarousel(responseId?: string, resolveId?: string): void;
|
|
477
484
|
get questionCarousel(): ChatQuestionCarouselPart | undefined;
|
|
@@ -495,4 +502,9 @@ export declare class ChatInputPart extends Disposable implements IHistoryNavigat
|
|
|
495
502
|
* Gets the location of the chat widget and whether that location is maximized.
|
|
496
503
|
*/
|
|
497
504
|
private getWidgetLocationInfo;
|
|
505
|
+
private getDefaultScrollbarOptions;
|
|
506
|
+
private getVisibleScrollbarOptions;
|
|
507
|
+
private updateInputEditorScrollbarOptions;
|
|
508
|
+
showScrollbarUntilAccept(): void;
|
|
509
|
+
private resetScrollbarVisibilityAfterAccept;
|
|
498
510
|
}
|