@codingame/monaco-vscode-katex-common 26.2.1 → 27.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/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +35 -11
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +168 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
- 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 +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +381 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +109 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -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/chatAttachmentsContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
- 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/chatDiffBlockPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +52 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +36 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
- 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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
- 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 +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +244 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +252 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +5 -5
- 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.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +48 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +351 -422
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +69 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
- 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 +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +63 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
- 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.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +441 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
- 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 +52 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +86 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +20 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +108 -27
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
- 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/inlineChat.css +0 -42
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
- 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/input/modelPickerActionItem.js +0 -187
- /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
|
@@ -144,6 +144,7 @@ export declare class ChatListWidget extends Disposable {
|
|
|
144
144
|
private _lastItem;
|
|
145
145
|
private _mostRecentlyFocusedItemIndex;
|
|
146
146
|
private _scrollLock;
|
|
147
|
+
private _suppressAutoScroll;
|
|
147
148
|
private _settingChangeCounter;
|
|
148
149
|
private _visibleChangeCount;
|
|
149
150
|
private readonly _container;
|
|
@@ -240,6 +241,11 @@ export declare class ChatListWidget extends Disposable {
|
|
|
240
241
|
* Scroll the list to reveal the last item.
|
|
241
242
|
*/
|
|
242
243
|
scrollToEnd(): void;
|
|
244
|
+
/**
|
|
245
|
+
* Suppress auto-scroll behavior temporarily. While suppressed,
|
|
246
|
+
* _withPersistedAutoScroll will not scroll to bottom after operations.
|
|
247
|
+
*/
|
|
248
|
+
set suppressAutoScroll(value: boolean);
|
|
243
249
|
private _withPersistedAutoScroll;
|
|
244
250
|
/**
|
|
245
251
|
* Focus the list.
|
|
@@ -105,6 +105,7 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
105
105
|
this._visible = true;
|
|
106
106
|
this._mostRecentlyFocusedItemIndex = -1;
|
|
107
107
|
this._scrollLock = true;
|
|
108
|
+
this._suppressAutoScroll = false;
|
|
108
109
|
this._settingChangeCounter = 0;
|
|
109
110
|
this._visibleChangeCount = 0;
|
|
110
111
|
this._bodyDimension = null;
|
|
@@ -310,19 +311,19 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
310
311
|
collapsible: false
|
|
311
312
|
})));
|
|
312
313
|
const editing = this._viewModel.editing;
|
|
313
|
-
const checkpoint = this._viewModel.model?.checkpoint;
|
|
314
314
|
this._withPersistedAutoScroll(() => {
|
|
315
315
|
this._tree.setChildren(null, treeItems, {
|
|
316
316
|
diffIdentityProvider: {
|
|
317
317
|
getId: element => {
|
|
318
318
|
const baseId = (isRequestVM(element) || isResponseVM(element)) ? element.dataId : element.id;
|
|
319
319
|
const disablement = (isRequestVM(element) || isResponseVM(element)) ? element.shouldBeRemovedOnSend : undefined;
|
|
320
|
+
const isEditTarget = isRequestVM(element) && editing?.id === element.id;
|
|
321
|
+
const isBlocked = (isRequestVM(element) || isResponseVM(element)) ? element.shouldBeBlocked.get() : false;
|
|
320
322
|
return (
|
|
321
323
|
baseId +
|
|
322
324
|
`${isResponseVM(element) && element.renderData ? `_${this._visibleChangeCount}` : ""}` + (isResponseVM(element) ? `_${element.contentReferences.length}` : "") +
|
|
323
325
|
`_${disablement ? `${disablement.afterUndoStop || "1"}` : "0"}` +
|
|
324
|
-
`_${editing ? "1" : "0"}` +
|
|
325
|
-
`_${checkpoint ? "1" : "0"}` +
|
|
326
|
+
`_${isEditTarget ? "edit" : ""}` + `_${isBlocked ? "blocked" : ""}` + (isRequestVM(element) ? `_${editing ? "1" : "0"}` : "") +
|
|
326
327
|
`_setting${this._settingChangeCounter}` + (isRequestVM(element) && element.contentReferences ? `_${element.contentReferences?.length}` : "")
|
|
327
328
|
);
|
|
328
329
|
}
|
|
@@ -417,7 +418,14 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
420
|
}
|
|
421
|
+
set suppressAutoScroll(value) {
|
|
422
|
+
this._suppressAutoScroll = value;
|
|
423
|
+
}
|
|
420
424
|
_withPersistedAutoScroll(fn) {
|
|
425
|
+
if (this._suppressAutoScroll) {
|
|
426
|
+
fn();
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
421
429
|
const wasScrolledToBottom = this.isScrolledToBottom;
|
|
422
430
|
fn();
|
|
423
431
|
if (wasScrolledToBottom) {
|
|
@@ -473,9 +481,10 @@ let ChatListWidget = class ChatListWidget extends Disposable {
|
|
|
473
481
|
this._container.style.removeProperty("--chat-current-response-min-height");
|
|
474
482
|
} else {
|
|
475
483
|
const secondToLastItem = this._viewModel?.getItems().at(-2);
|
|
484
|
+
const maxRequestShownHeight = 200;
|
|
476
485
|
const secondToLastItemHeight = Math.min(
|
|
477
486
|
(isRequestVM(secondToLastItem) || isResponseVM(secondToLastItem)) ? secondToLastItem.currentRenderedHeight ?? 150 : 150,
|
|
478
|
-
|
|
487
|
+
maxRequestShownHeight
|
|
479
488
|
);
|
|
480
489
|
const lastItemMinHeight = Math.max(contentHeight - (secondToLastItemHeight + 10), 0);
|
|
481
490
|
this._container.style.setProperty("--chat-current-response-min-height", lastItemMinHeight + "px");
|
package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
+
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
5
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
6
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { IChatQuestionCarousel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
8
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
9
|
+
/**
|
|
10
|
+
* Encapsulates the logic for automatically replying to question carousels,
|
|
11
|
+
* including opt-in state management, LLM-based answer resolution, fallback
|
|
12
|
+
* answer generation, and answer parsing/merging.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ChatQuestionCarouselAutoReply extends Disposable {
|
|
15
|
+
private readonly configService;
|
|
16
|
+
private readonly dialogService;
|
|
17
|
+
private readonly logService;
|
|
18
|
+
private readonly storageService;
|
|
19
|
+
private readonly languageModelsService;
|
|
20
|
+
constructor(configService: IConfigurationService, dialogService: IDialogService, logService: ILogService, storageService: IStorageService, languageModelsService: ILanguageModelsService);
|
|
21
|
+
shouldAutoReply(): Promise<boolean>;
|
|
22
|
+
autoReply(carousel: IChatQuestionCarousel, submit: (answers: Map<string, unknown> | undefined) => Promise<void>, modelName: string | undefined, requestMessageText: string | undefined, token: CancellationToken): Promise<void>;
|
|
23
|
+
private checkOptIn;
|
|
24
|
+
private getModelId;
|
|
25
|
+
private buildPrompt;
|
|
26
|
+
private requestAnswers;
|
|
27
|
+
private parseAnswers;
|
|
28
|
+
private mergeAnswers;
|
|
29
|
+
private hasDefaultValue;
|
|
30
|
+
private resolveAnswerFromRaw;
|
|
31
|
+
private matchQuestionOption;
|
|
32
|
+
buildFallbackCarouselAnswers(carousel: IChatQuestionCarousel, requestMessageText: string | undefined): Map<string, unknown>;
|
|
33
|
+
private getFallbackAnswerForQuestion;
|
|
34
|
+
private tryParseJsonObject;
|
|
35
|
+
}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
+
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
5
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
8
|
+
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
10
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
12
|
+
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
13
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
14
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
15
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
16
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
17
|
+
import { ChatMessageRole, getTextResponseFromStream } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
18
|
+
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
19
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
20
|
+
|
|
21
|
+
var AutoReplyStorageKeys;
|
|
22
|
+
(function(AutoReplyStorageKeys) {
|
|
23
|
+
AutoReplyStorageKeys["AutoReplyOptIn"] = "chat.autoReply.optIn";
|
|
24
|
+
})(AutoReplyStorageKeys || (AutoReplyStorageKeys = {}));
|
|
25
|
+
let ChatQuestionCarouselAutoReply = class ChatQuestionCarouselAutoReply extends Disposable {
|
|
26
|
+
constructor(
|
|
27
|
+
configService,
|
|
28
|
+
dialogService,
|
|
29
|
+
logService,
|
|
30
|
+
storageService,
|
|
31
|
+
languageModelsService
|
|
32
|
+
) {
|
|
33
|
+
super();
|
|
34
|
+
this.configService = configService;
|
|
35
|
+
this.dialogService = dialogService;
|
|
36
|
+
this.logService = logService;
|
|
37
|
+
this.storageService = storageService;
|
|
38
|
+
this.languageModelsService = languageModelsService;
|
|
39
|
+
this._register(Event.runAndSubscribe(this.configService.onDidChangeConfiguration, e => {
|
|
40
|
+
if (!e || e.affectsConfiguration(ChatConfiguration.AutoReply)) {
|
|
41
|
+
if (this.configService.getValue(ChatConfiguration.AutoReply) !== true) {
|
|
42
|
+
this.storageService.remove(AutoReplyStorageKeys.AutoReplyOptIn, StorageScope.APPLICATION);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
async shouldAutoReply() {
|
|
48
|
+
if (!this.configService.getValue(ChatConfiguration.AutoReply)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return this.checkOptIn();
|
|
52
|
+
}
|
|
53
|
+
async autoReply(carousel, submit, modelName, requestMessageText, token) {
|
|
54
|
+
if (token.isCancellationRequested || carousel.isUsed || carousel.questions.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const fallbackAnswers = this.buildFallbackCarouselAnswers(carousel, requestMessageText);
|
|
58
|
+
let resolvedAnswers = fallbackAnswers;
|
|
59
|
+
const modelId = await this.getModelId(modelName);
|
|
60
|
+
if (modelId && !token.isCancellationRequested) {
|
|
61
|
+
try {
|
|
62
|
+
const parsedAnswers = await this.requestAnswers(modelId, carousel, requestMessageText, token);
|
|
63
|
+
if (parsedAnswers.size > 0) {
|
|
64
|
+
resolvedAnswers = this.mergeAnswers(carousel, parsedAnswers, fallbackAnswers);
|
|
65
|
+
}
|
|
66
|
+
} catch (err) {
|
|
67
|
+
this.logService.debug("#ChatQuestionCarousel: Failed to resolve auto reply", toErrorMessage(err));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (token.isCancellationRequested || carousel.isUsed) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
await submit(resolvedAnswers);
|
|
74
|
+
}
|
|
75
|
+
async checkOptIn() {
|
|
76
|
+
const optedIn = this.storageService.getBoolean(AutoReplyStorageKeys.AutoReplyOptIn, StorageScope.APPLICATION, false);
|
|
77
|
+
if (optedIn) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
const promptResult = await this.dialogService.prompt({
|
|
81
|
+
type: Severity.Warning,
|
|
82
|
+
message: ( localize(6659, "Enable chat auto reply?")),
|
|
83
|
+
buttons: [{
|
|
84
|
+
label: ( localize(6660, "Enable")),
|
|
85
|
+
run: () => true
|
|
86
|
+
}, {
|
|
87
|
+
label: ( localize(6661, "Disable")),
|
|
88
|
+
run: () => false
|
|
89
|
+
}],
|
|
90
|
+
custom: {
|
|
91
|
+
icon: Codicon.warning,
|
|
92
|
+
disableCloseAction: true,
|
|
93
|
+
markdownDetails: [{
|
|
94
|
+
markdown: ( new MarkdownString(( localize(
|
|
95
|
+
6662,
|
|
96
|
+
"Chat auto reply answers question carousels using the current model and may make unintended choices. Review your settings and outputs carefully."
|
|
97
|
+
))))
|
|
98
|
+
}]
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
if (promptResult.result !== true) {
|
|
102
|
+
await this.configService.updateValue(ChatConfiguration.AutoReply, false);
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
this.storageService.store(
|
|
106
|
+
AutoReplyStorageKeys.AutoReplyOptIn,
|
|
107
|
+
true,
|
|
108
|
+
StorageScope.APPLICATION,
|
|
109
|
+
StorageTarget.USER
|
|
110
|
+
);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
async getModelId(modelName) {
|
|
114
|
+
if (!modelName) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
let models = await this.languageModelsService.selectLanguageModels({
|
|
118
|
+
id: modelName
|
|
119
|
+
});
|
|
120
|
+
if (models.length > 0) {
|
|
121
|
+
return models[0];
|
|
122
|
+
}
|
|
123
|
+
if (modelName.startsWith("copilot/")) {
|
|
124
|
+
models = await this.languageModelsService.selectLanguageModels({
|
|
125
|
+
vendor: "copilot",
|
|
126
|
+
family: modelName.replace(/^copilot\//, "")
|
|
127
|
+
});
|
|
128
|
+
return models[0];
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
buildPrompt(carousel, requestMessageText, strict) {
|
|
133
|
+
const questions = ( carousel.questions.map(question => ({
|
|
134
|
+
id: question.id,
|
|
135
|
+
type: question.type,
|
|
136
|
+
title: question.title,
|
|
137
|
+
message: typeof question.message === "string" ? question.message : question.message?.value,
|
|
138
|
+
options: question.options?.map(option => ({
|
|
139
|
+
id: option.id,
|
|
140
|
+
label: option.label
|
|
141
|
+
})) ?? [],
|
|
142
|
+
allowFreeformInput: question.allowFreeformInput ?? false
|
|
143
|
+
})));
|
|
144
|
+
const contextLines = [];
|
|
145
|
+
if (requestMessageText) {
|
|
146
|
+
contextLines.push(`Original user request: ${JSON.stringify(requestMessageText)}`);
|
|
147
|
+
}
|
|
148
|
+
return [
|
|
149
|
+
"Choose default answers for the following questions.",
|
|
150
|
+
"Return a JSON object keyed by question id.",
|
|
151
|
+
"For text questions, the value should be a string.",
|
|
152
|
+
"For singleSelect questions, the value should be { \"selectedId\": string } or { \"freeform\": string }.",
|
|
153
|
+
"For multiSelect questions, the value should be { \"selectedIds\": string[] } and may include { \"freeform\": string }.",
|
|
154
|
+
"If a question allows freeform input and has no options, return a freeform answer based on the user request when possible.",
|
|
155
|
+
"Use option ids from the provided options.",
|
|
156
|
+
...contextLines,
|
|
157
|
+
"Questions:",
|
|
158
|
+
JSON.stringify(questions),
|
|
159
|
+
strict ? "Return ONLY valid JSON. Do not include markdown or explanations." : undefined
|
|
160
|
+
].filter(Boolean).join("\n");
|
|
161
|
+
}
|
|
162
|
+
async requestAnswers(modelId, carousel, requestMessageText, token) {
|
|
163
|
+
const prompt = this.buildPrompt(carousel, requestMessageText, false);
|
|
164
|
+
const response = await this.languageModelsService.sendChatRequest(modelId, ( new ExtensionIdentifier("core")), [{
|
|
165
|
+
role: ChatMessageRole.User,
|
|
166
|
+
content: [{
|
|
167
|
+
type: "text",
|
|
168
|
+
value: prompt
|
|
169
|
+
}]
|
|
170
|
+
}], {}, token);
|
|
171
|
+
const responseText = await getTextResponseFromStream(response);
|
|
172
|
+
const parsedAnswers = this.parseAnswers(responseText, carousel);
|
|
173
|
+
if (parsedAnswers.size > 0 || token.isCancellationRequested) {
|
|
174
|
+
return parsedAnswers;
|
|
175
|
+
}
|
|
176
|
+
const retryPrompt = this.buildPrompt(carousel, requestMessageText, true);
|
|
177
|
+
const retryResponse = await this.languageModelsService.sendChatRequest(modelId, ( new ExtensionIdentifier("core")), [{
|
|
178
|
+
role: ChatMessageRole.User,
|
|
179
|
+
content: [{
|
|
180
|
+
type: "text",
|
|
181
|
+
value: retryPrompt
|
|
182
|
+
}]
|
|
183
|
+
}], {}, token);
|
|
184
|
+
const retryText = await getTextResponseFromStream(retryResponse);
|
|
185
|
+
return this.parseAnswers(retryText, carousel);
|
|
186
|
+
}
|
|
187
|
+
parseAnswers(responseText, carousel) {
|
|
188
|
+
const parsed = this.tryParseJsonObject(responseText);
|
|
189
|
+
if (!parsed) {
|
|
190
|
+
return ( new Map());
|
|
191
|
+
}
|
|
192
|
+
const answers = ( new Map());
|
|
193
|
+
for (const question of carousel.questions) {
|
|
194
|
+
const rawAnswer = parsed[question.id];
|
|
195
|
+
const resolved = this.resolveAnswerFromRaw(question, rawAnswer);
|
|
196
|
+
if (resolved !== undefined) {
|
|
197
|
+
answers.set(question.id, resolved);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return answers;
|
|
201
|
+
}
|
|
202
|
+
mergeAnswers(carousel, resolvedAnswers, fallbackAnswers) {
|
|
203
|
+
const merged = ( new Map());
|
|
204
|
+
for (const question of carousel.questions) {
|
|
205
|
+
const fallback = fallbackAnswers.get(question.id);
|
|
206
|
+
if (this.hasDefaultValue(question) && fallback !== undefined) {
|
|
207
|
+
merged.set(question.id, fallback);
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
if (( resolvedAnswers.has(question.id))) {
|
|
211
|
+
merged.set(question.id, resolvedAnswers.get(question.id));
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
if (fallback !== undefined) {
|
|
215
|
+
merged.set(question.id, fallback);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return merged;
|
|
219
|
+
}
|
|
220
|
+
hasDefaultValue(question) {
|
|
221
|
+
switch (question.type) {
|
|
222
|
+
case "text":
|
|
223
|
+
return question.defaultValue !== undefined;
|
|
224
|
+
case "singleSelect":
|
|
225
|
+
return typeof question.defaultValue === "string";
|
|
226
|
+
case "multiSelect":
|
|
227
|
+
return Array.isArray(question.defaultValue) ? question.defaultValue.length > 0 : typeof question.defaultValue === "string";
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
resolveAnswerFromRaw(question, raw) {
|
|
231
|
+
switch (question.type) {
|
|
232
|
+
case "text":
|
|
233
|
+
{
|
|
234
|
+
if (typeof raw === "string") {
|
|
235
|
+
const value = raw.trim();
|
|
236
|
+
return value.length > 0 ? value : undefined;
|
|
237
|
+
}
|
|
238
|
+
if (raw && typeof raw === "object" && hasKey(raw, {
|
|
239
|
+
value: true
|
|
240
|
+
}) && typeof raw.value === "string") {
|
|
241
|
+
const value = raw.value.trim();
|
|
242
|
+
return value.length > 0 ? value : undefined;
|
|
243
|
+
}
|
|
244
|
+
return undefined;
|
|
245
|
+
}
|
|
246
|
+
case "singleSelect":
|
|
247
|
+
{
|
|
248
|
+
let selectedInput;
|
|
249
|
+
let freeformInput;
|
|
250
|
+
if (typeof raw === "string") {
|
|
251
|
+
selectedInput = raw;
|
|
252
|
+
} else if (raw && typeof raw === "object") {
|
|
253
|
+
if (hasKey(raw, {
|
|
254
|
+
selectedId: true
|
|
255
|
+
}) && typeof raw.selectedId === "string") {
|
|
256
|
+
selectedInput = raw.selectedId;
|
|
257
|
+
} else if (hasKey(raw, {
|
|
258
|
+
selectedLabel: true
|
|
259
|
+
}) && typeof raw.selectedLabel === "string") {
|
|
260
|
+
selectedInput = raw.selectedLabel;
|
|
261
|
+
}
|
|
262
|
+
if (hasKey(raw, {
|
|
263
|
+
freeform: true
|
|
264
|
+
}) && typeof raw.freeform === "string") {
|
|
265
|
+
freeformInput = raw.freeform;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (freeformInput && freeformInput.trim().length > 0) {
|
|
269
|
+
return {
|
|
270
|
+
selectedValue: undefined,
|
|
271
|
+
freeformValue: freeformInput.trim()
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
const match = selectedInput ? this.matchQuestionOption(question, selectedInput) : undefined;
|
|
275
|
+
if (match) {
|
|
276
|
+
return {
|
|
277
|
+
selectedValue: match.value,
|
|
278
|
+
freeformValue: undefined
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
case "multiSelect":
|
|
284
|
+
{
|
|
285
|
+
let selectedInputs = [];
|
|
286
|
+
let freeformInput;
|
|
287
|
+
if (Array.isArray(raw)) {
|
|
288
|
+
selectedInputs = raw.filter(item => typeof item === "string");
|
|
289
|
+
} else if (typeof raw === "string") {
|
|
290
|
+
selectedInputs = ( raw.split(",").map(item => item.trim())).filter(item => item.length > 0);
|
|
291
|
+
} else if (raw && typeof raw === "object") {
|
|
292
|
+
if (hasKey(raw, {
|
|
293
|
+
selectedIds: true
|
|
294
|
+
})) {
|
|
295
|
+
const selectedIdsValue = raw.selectedIds;
|
|
296
|
+
if (Array.isArray(selectedIdsValue)) {
|
|
297
|
+
selectedInputs = selectedIdsValue.filter(item => typeof item === "string");
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (hasKey(raw, {
|
|
301
|
+
freeform: true
|
|
302
|
+
}) && typeof raw.freeform === "string") {
|
|
303
|
+
freeformInput = raw.freeform;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
const selectedValues = ( selectedInputs.map(input => this.matchQuestionOption(question, input)?.value)).filter(value => value !== undefined);
|
|
307
|
+
const freeformValue = freeformInput?.trim();
|
|
308
|
+
if (selectedValues.length > 0 || (freeformValue && freeformValue.length > 0)) {
|
|
309
|
+
return {
|
|
310
|
+
selectedValues,
|
|
311
|
+
freeformValue
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
matchQuestionOption(question, rawInput) {
|
|
319
|
+
const options = question.options ?? [];
|
|
320
|
+
if (!options.length) {
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
const normalized = rawInput.trim().toLowerCase();
|
|
324
|
+
const numeric = Number.parseInt(normalized, 10);
|
|
325
|
+
if (!Number.isNaN(numeric) && numeric > 0 && numeric <= options.length) {
|
|
326
|
+
const option = options[numeric - 1];
|
|
327
|
+
return {
|
|
328
|
+
id: option.id,
|
|
329
|
+
value: option.value
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
const exactId = options.find(option => option.id.toLowerCase() === normalized);
|
|
333
|
+
if (exactId) {
|
|
334
|
+
return {
|
|
335
|
+
id: exactId.id,
|
|
336
|
+
value: exactId.value
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const exactLabel = options.find(option => option.label.toLowerCase() === normalized);
|
|
340
|
+
if (exactLabel) {
|
|
341
|
+
return {
|
|
342
|
+
id: exactLabel.id,
|
|
343
|
+
value: exactLabel.value
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
const partialLabel = options.find(option => option.label.toLowerCase().includes(normalized));
|
|
347
|
+
if (partialLabel) {
|
|
348
|
+
return {
|
|
349
|
+
id: partialLabel.id,
|
|
350
|
+
value: partialLabel.value
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
return undefined;
|
|
354
|
+
}
|
|
355
|
+
buildFallbackCarouselAnswers(carousel, requestMessageText) {
|
|
356
|
+
const answers = ( new Map());
|
|
357
|
+
for (const question of carousel.questions) {
|
|
358
|
+
const answer = this.getFallbackAnswerForQuestion(question, requestMessageText);
|
|
359
|
+
if (answer !== undefined) {
|
|
360
|
+
answers.set(question.id, answer);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return answers;
|
|
364
|
+
}
|
|
365
|
+
getFallbackAnswerForQuestion(question, requestMessageText) {
|
|
366
|
+
const fallbackFreeform = requestMessageText?.trim() || ( localize(6663, "OK"));
|
|
367
|
+
switch (question.type) {
|
|
368
|
+
case "text":
|
|
369
|
+
return question.defaultValue ?? fallbackFreeform;
|
|
370
|
+
case "singleSelect":
|
|
371
|
+
{
|
|
372
|
+
const defaultOptionId = typeof question.defaultValue === "string" ? question.defaultValue : undefined;
|
|
373
|
+
const defaultOption = defaultOptionId ? question.options?.find(opt => opt.id === defaultOptionId) : undefined;
|
|
374
|
+
if (defaultOption) {
|
|
375
|
+
return {
|
|
376
|
+
selectedValue: defaultOption.value,
|
|
377
|
+
freeformValue: undefined
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
if (question.options && question.options.length > 0) {
|
|
381
|
+
return {
|
|
382
|
+
selectedValue: question.options[0].value,
|
|
383
|
+
freeformValue: undefined
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
if (question.allowFreeformInput) {
|
|
387
|
+
return {
|
|
388
|
+
selectedValue: undefined,
|
|
389
|
+
freeformValue: fallbackFreeform
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
return undefined;
|
|
393
|
+
}
|
|
394
|
+
case "multiSelect":
|
|
395
|
+
{
|
|
396
|
+
const defaultIds = Array.isArray(question.defaultValue) ? question.defaultValue : (typeof question.defaultValue === "string" ? [question.defaultValue] : []);
|
|
397
|
+
const selectedValues = question.options?.filter(opt => defaultIds.includes(opt.id)).map(opt => opt.value).filter(value => value !== undefined) ?? [];
|
|
398
|
+
if (selectedValues.length > 0) {
|
|
399
|
+
return {
|
|
400
|
+
selectedValues,
|
|
401
|
+
freeformValue: undefined
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
if (question.options && question.options.length > 0) {
|
|
405
|
+
return {
|
|
406
|
+
selectedValues: [question.options[0].value],
|
|
407
|
+
freeformValue: undefined
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
if (question.allowFreeformInput) {
|
|
411
|
+
return {
|
|
412
|
+
selectedValues: [],
|
|
413
|
+
freeformValue: fallbackFreeform
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
return undefined;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
tryParseJsonObject(text) {
|
|
421
|
+
const trimmed = text.trim();
|
|
422
|
+
if (!trimmed) {
|
|
423
|
+
return undefined;
|
|
424
|
+
}
|
|
425
|
+
const start = trimmed.indexOf("{");
|
|
426
|
+
const end = trimmed.lastIndexOf("}");
|
|
427
|
+
const candidate = start >= 0 && end > start ? trimmed.slice(start, end + 1) : trimmed;
|
|
428
|
+
try {
|
|
429
|
+
const parsed = JSON.parse(candidate);
|
|
430
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
431
|
+
return parsed;
|
|
432
|
+
}
|
|
433
|
+
} catch {
|
|
434
|
+
return undefined;
|
|
435
|
+
}
|
|
436
|
+
return undefined;
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
ChatQuestionCarouselAutoReply = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IDialogService)), ( __param(2, ILogService)), ( __param(3, IStorageService)), ( __param(4, ILanguageModelsService))], ChatQuestionCarouselAutoReply));
|
|
440
|
+
|
|
441
|
+
export { ChatQuestionCarouselAutoReply };
|
|
@@ -35,8 +35,11 @@ import { ChatTreeItem, IChatAcceptInputOptions, IChatCodeBlockInfo, IChatFileTre
|
|
|
35
35
|
import { IChatAccessibilityService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
36
36
|
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
37
37
|
import { ChatAttachmentModel } from "../attachments/chatAttachmentModel.js";
|
|
38
|
+
import { IChatAttachmentResolveService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service";
|
|
38
39
|
import { ChatInputPart, IChatInputStyles } from "./input/chatInputPart.js";
|
|
40
|
+
import { IChatTipService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatTipService.service";
|
|
39
41
|
import { IAgentSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service";
|
|
42
|
+
import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service";
|
|
40
43
|
export interface IChatWidgetStyles extends IChatInputStyles {
|
|
41
44
|
readonly inputEditorBackground: string;
|
|
42
45
|
readonly resultEditorBackground: string;
|
|
@@ -85,6 +88,9 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
85
88
|
private readonly chatTodoListService;
|
|
86
89
|
private readonly contextService;
|
|
87
90
|
private readonly lifecycleService;
|
|
91
|
+
private readonly chatAttachmentResolveService;
|
|
92
|
+
private readonly chatTipService;
|
|
93
|
+
private readonly chatDebugService;
|
|
88
94
|
static readonly CONTRIBS: {
|
|
89
95
|
new (...args: [
|
|
90
96
|
IChatWidget,
|
|
@@ -115,6 +121,8 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
115
121
|
readonly onDidShow: Event<void>;
|
|
116
122
|
private _onDidChangeParsedInput;
|
|
117
123
|
readonly onDidChangeParsedInput: Event<void>;
|
|
124
|
+
private _onDidChangeActiveInputEditor;
|
|
125
|
+
readonly onDidChangeActiveInputEditor: Event<void>;
|
|
118
126
|
private readonly _onWillMaybeChangeHeight;
|
|
119
127
|
readonly onWillMaybeChangeHeight: Event<void>;
|
|
120
128
|
private _onDidChangeHeight;
|
|
@@ -139,6 +147,8 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
139
147
|
private recentlyRestoredCheckpoint;
|
|
140
148
|
private welcomeMessageContainer;
|
|
141
149
|
private readonly welcomePart;
|
|
150
|
+
private readonly _gettingStartedTipPart;
|
|
151
|
+
private _gettingStartedTipPartRef;
|
|
142
152
|
private readonly chatSuggestNextWidget;
|
|
143
153
|
private bodyDimension;
|
|
144
154
|
private visibleChangeCount;
|
|
@@ -154,6 +164,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
154
164
|
private readonly _agentSupportsAttachmentsContextKey;
|
|
155
165
|
private readonly _sessionIsEmptyContextKey;
|
|
156
166
|
private readonly _hasPendingRequestsContextKey;
|
|
167
|
+
private readonly _sessionHasDebugDataContextKey;
|
|
157
168
|
private _attachmentCapabilities;
|
|
158
169
|
private readonly promptDescriptionsCache;
|
|
159
170
|
private readonly promptUriCache;
|
|
@@ -163,6 +174,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
163
174
|
private set viewModel(value);
|
|
164
175
|
get viewModel(): ChatViewModel | undefined;
|
|
165
176
|
private readonly _editingSession;
|
|
177
|
+
private readonly _viewModelObs;
|
|
166
178
|
private parsedChatRequest;
|
|
167
179
|
get parsedInput(): IParsedChatRequest;
|
|
168
180
|
get scopedContextKeyService(): IContextKeyService;
|
|
@@ -171,7 +183,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
171
183
|
readonly viewContext: IChatWidgetViewContext;
|
|
172
184
|
get supportsChangingModes(): boolean;
|
|
173
185
|
get locationData(): IChatLocationData | undefined;
|
|
174
|
-
constructor(location: ChatAgentLocation | IChatWidgetLocationOptions, viewContext: IChatWidgetViewContext | undefined, viewOptions: IChatWidgetViewOptions, styles: IChatWidgetStyles, codeEditorService: ICodeEditorService, editorService: IEditorService, 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, contextService: IWorkspaceContextService, lifecycleService: ILifecycleService);
|
|
186
|
+
constructor(location: ChatAgentLocation | IChatWidgetLocationOptions, viewContext: IChatWidgetViewContext | undefined, viewOptions: IChatWidgetViewOptions, styles: IChatWidgetStyles, codeEditorService: ICodeEditorService, editorService: IEditorService, 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, contextService: IWorkspaceContextService, lifecycleService: ILifecycleService, chatAttachmentResolveService: IChatAttachmentResolveService, chatTipService: IChatTipService, chatDebugService: IChatDebugService);
|
|
175
187
|
private _lastSelectedAgent;
|
|
176
188
|
set lastSelectedAgent(agent: IChatAgentData | undefined);
|
|
177
189
|
get lastSelectedAgent(): IChatAgentData | undefined;
|
|
@@ -189,9 +201,18 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
189
201
|
private get inlineInputPart();
|
|
190
202
|
get inputEditor(): ICodeEditor;
|
|
191
203
|
get contentHeight(): number;
|
|
204
|
+
get scrollTop(): number;
|
|
205
|
+
set scrollTop(value: number);
|
|
192
206
|
get attachmentModel(): ChatAttachmentModel;
|
|
193
207
|
render(parent: HTMLElement): void;
|
|
194
208
|
focusInput(): void;
|
|
209
|
+
focusTodosView(): boolean;
|
|
210
|
+
toggleTodosViewFocus(): boolean;
|
|
211
|
+
focusQuestionCarousel(): boolean;
|
|
212
|
+
toggleQuestionCarouselFocus(): boolean;
|
|
213
|
+
navigateToPreviousQuestion(): boolean;
|
|
214
|
+
navigateToNextQuestion(): boolean;
|
|
215
|
+
toggleTipFocus(): boolean;
|
|
195
216
|
hasInputFocus(): boolean;
|
|
196
217
|
refreshParsedInput(): void;
|
|
197
218
|
getSibling(item: ChatTreeItem, type: "next" | "previous"): ChatTreeItem | undefined;
|
|
@@ -206,6 +227,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
206
227
|
* Renders the welcome view content when needed.
|
|
207
228
|
*/
|
|
208
229
|
private renderWelcomeViewContentIfNeeded;
|
|
230
|
+
private renderGettingStartedTipIfNeeded;
|
|
209
231
|
private _getGenerateInstructionsMessage;
|
|
210
232
|
/**
|
|
211
233
|
* Checks if any agent instruction files (.github/copilot-instructions.md or AGENTS.md) exist in the workspace.
|
|
@@ -256,6 +278,7 @@ export declare class ChatWidget extends Disposable implements IChatWidget {
|
|
|
256
278
|
rerunLastRequest(): Promise<void>;
|
|
257
279
|
private _applyPromptFileIfSet;
|
|
258
280
|
private _acceptInput;
|
|
281
|
+
private _resolveDirectoryImageAttachments;
|
|
259
282
|
private confirmPendingRequestsBeforeSend;
|
|
260
283
|
getModeRequestOptions(): Partial<IChatSendRequestOptions>;
|
|
261
284
|
getCodeBlockInfosForResponse(response: IChatResponseViewModel): IChatCodeBlockInfo[];
|