@codingame/monaco-vscode-katex-common 26.2.2 → 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 +51 -20
- 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 +241 -78
- 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 +61 -66
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { $ as $$1, clearNode, h, append, addStandardDisposableListener, EventType, DisposableResizeObserver, setVisibility, isKeyboardEvent, getActiveElement, getWindow, addDisposableListener, getTotalWidth
|
|
3
|
+
import { $ as $$1, clearNode, h, append, addStandardDisposableListener, EventType, DisposableResizeObserver, setVisibility, isKeyboardEvent, getActiveElement, getWindow, addDisposableListener, getTotalWidth } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { DEFAULT_FONT_FAMILY } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fonts';
|
|
5
5
|
import { hasModifierKeys } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
6
6
|
import { BaseActionViewItem, ActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
@@ -8,7 +8,6 @@ import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/a
|
|
|
8
8
|
import { ButtonWithIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
9
9
|
import { createInstantHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
10
10
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
11
|
-
import { renderLabelWithIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
12
11
|
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
13
12
|
import { RunOnceScheduler, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
14
13
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
@@ -26,7 +25,6 @@ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/in
|
|
|
26
25
|
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
27
26
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
28
27
|
import { ScrollbarVisibility } from '@codingame/monaco-vscode-api/vscode/vs/base/common/scrollable';
|
|
29
|
-
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
30
28
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
31
29
|
import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
32
30
|
import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
@@ -77,7 +75,7 @@ import { AccessibilityCommandId } from '@codingame/monaco-vscode-api/vscode/vs/w
|
|
|
77
75
|
import { getSimpleEditorOptions, getSimpleCodeEditorWidgetOptions, setupSimpleEditorSelectionStyling } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
78
76
|
import { InlineChatConfigKeys } from '../../../../inlineChat/common/inlineChat.js';
|
|
79
77
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
80
|
-
import { ChatRequestVariableSet, isImageVariableEntry, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry
|
|
78
|
+
import { ChatRequestVariableSet, isImageVariableEntry, isStringVariableEntry, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
81
79
|
import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
82
80
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
83
81
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
@@ -87,15 +85,17 @@ import { ChatAgentLocation, ChatModeKind, ChatConfiguration, validateChatMode }
|
|
|
87
85
|
import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
88
86
|
import { ILanguageModelChatMetadata } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
89
87
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
88
|
+
import { ChatQuestionCarouselData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatQuestionCarouselData';
|
|
90
89
|
import { getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
91
90
|
import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
92
91
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
93
92
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
94
93
|
import { ChatHistoryNavigator } from '../../../common/widget/chatWidgetHistoryService.js';
|
|
95
94
|
import { ChatSubmitAction, OpenModelPickerAction, OpenModePickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction, OpenWorkspacePickerAction, ChatSessionPrimaryPickerAction } from '../../actions/chatExecuteActions.js';
|
|
96
|
-
import {
|
|
95
|
+
import { AgentSessionProviders, getAgentSessionProvider } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
97
96
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
98
97
|
import { ChatAttachmentModel } from '../../attachments/chatAttachmentModel.js';
|
|
98
|
+
import { IChatAttachmentWidgetRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service';
|
|
99
99
|
import { ToolSetOrToolItemAttachmentWidget, NotebookCellOutputChatAttachmentWidget, PromptFileAttachmentWidget, PromptTextAttachmentWidget, FileAttachmentWidget, TerminalCommandAttachmentWidget, ImageAttachmentWidget, ElementChatAttachmentWidget, PasteAttachmentWidget, SCMHistoryItemAttachmentWidget, SCMHistoryItemChangeAttachmentWidget, SCMHistoryItemChangeRangeAttachmentWidget, DefaultChatAttachmentWidget } from '../../attachments/chatAttachmentWidgets.js';
|
|
100
100
|
import { ChatImplicitContexts } from '../../attachments/chatImplicitContext.js';
|
|
101
101
|
import { ImplicitContextAttachmentWidget } from '../../attachments/implicitContextAttachment.js';
|
|
@@ -113,12 +113,12 @@ import { ChatFollowups } from './chatFollowups.js';
|
|
|
113
113
|
import { ChatInputPartWidgetController } from './chatInputPartWidgets.js';
|
|
114
114
|
import { ChatSelectedTools } from './chatSelectedTools.js';
|
|
115
115
|
import { DelegationSessionPickerActionItem } from './delegationSessionPickerActionItem.js';
|
|
116
|
-
import { ModelPickerActionItem } from './modelPickerActionItem.js';
|
|
117
116
|
import { ModePickerActionItem } from './modePickerActionItem.js';
|
|
118
117
|
import { SessionTypePickerActionItem } from './sessionTargetPickerActionItem.js';
|
|
119
118
|
import { WorkspacePickerActionItem } from './workspacePickerActionItem.js';
|
|
120
119
|
import { ChatContextUsageWidget } from '../../widgetHosts/viewPane/chatContextUsageWidget.js';
|
|
121
120
|
import { Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
121
|
+
import { EnhancedModelPickerActionItem } from './modelPickerActionItem2.js';
|
|
122
122
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
123
123
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
124
124
|
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
@@ -185,6 +185,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
185
185
|
get implicitContext() {
|
|
186
186
|
return this._implicitContext;
|
|
187
187
|
}
|
|
188
|
+
get inputContainerElement() {
|
|
189
|
+
return this.inputContainer;
|
|
190
|
+
}
|
|
191
|
+
get gettingStartedTipContainerElement() {
|
|
192
|
+
return this.chatGettingStartedTipContainer;
|
|
193
|
+
}
|
|
188
194
|
get inputEditor() {
|
|
189
195
|
return this._inputEditor;
|
|
190
196
|
}
|
|
@@ -265,7 +271,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
265
271
|
agentSessionsService,
|
|
266
272
|
workspaceContextService,
|
|
267
273
|
layoutService,
|
|
268
|
-
viewDescriptorService
|
|
274
|
+
viewDescriptorService,
|
|
275
|
+
_chatAttachmentWidgetRegistry
|
|
269
276
|
) {
|
|
270
277
|
super();
|
|
271
278
|
this.location = location;
|
|
@@ -297,6 +304,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
297
304
|
this.workspaceContextService = workspaceContextService;
|
|
298
305
|
this.layoutService = layoutService;
|
|
299
306
|
this.viewDescriptorService = viewDescriptorService;
|
|
307
|
+
this._chatAttachmentWidgetRegistry = _chatAttachmentWidgetRegistry;
|
|
300
308
|
this._workingSetCollapsed = observableValue("chatInputPart.workingSetCollapsed", true);
|
|
301
309
|
this._chatInputTodoListWidget = this._register(( new MutableDisposable()));
|
|
302
310
|
this._chatQuestionCarouselWidget = this._register(( new MutableDisposable()));
|
|
@@ -314,7 +322,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
314
322
|
this.onDidAcceptFollowup = this._onDidAcceptFollowup.event;
|
|
315
323
|
this._onDidClickOverlay = this._register(( new Emitter()));
|
|
316
324
|
this.onDidClickOverlay = this._onDidClickOverlay.event;
|
|
317
|
-
this._implicitContextWidget = this._register(( new MutableDisposable()));
|
|
318
325
|
this._indexOfLastAttachedContextDeletedWithKeyboard = -1;
|
|
319
326
|
this._indexOfLastOpenedContext = -1;
|
|
320
327
|
this._onDidChangeVisibility = this._register(( new Emitter()));
|
|
@@ -343,6 +350,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
343
350
|
this._attemptedWorkingSetEntriesCount = 0;
|
|
344
351
|
this._chatSessionIsEmpty = false;
|
|
345
352
|
this._pendingDelegationTarget = undefined;
|
|
353
|
+
this._currentSessionType = undefined;
|
|
346
354
|
this._syncTextDebounced = this._register(( new RunOnceScheduler(() => this._syncInputStateToModel(), 150)));
|
|
347
355
|
this._emptyInputState = this._register(
|
|
348
356
|
emptyInputState(StorageScope.WORKSPACE, StorageTarget.USER, this.storageService)
|
|
@@ -393,8 +401,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
393
401
|
this.inputEditorHasText = ChatContextKeys.inputHasText.bindTo(contextKeyService);
|
|
394
402
|
this.chatCursorAtTop = ChatContextKeys.inputCursorAtTop.bindTo(contextKeyService);
|
|
395
403
|
this.inputEditorHasFocus = ChatContextKeys.inputHasFocus.bindTo(contextKeyService);
|
|
404
|
+
this._hasQuestionCarouselContextKey = ChatContextKeys.Editing.hasQuestionCarousel.bindTo(contextKeyService);
|
|
396
405
|
this.chatModeKindKey = ChatContextKeys.chatModeKind.bindTo(contextKeyService);
|
|
397
406
|
this.chatModeNameKey = ChatContextKeys.chatModeName.bindTo(contextKeyService);
|
|
407
|
+
this.chatModelIdKey = ChatContextKeys.chatModelId.bindTo(contextKeyService);
|
|
398
408
|
this.withinEditSessionKey = ChatContextKeys.withinEditSessionDiff.bindTo(contextKeyService);
|
|
399
409
|
this.filePartOfEditSessionKey = ChatContextKeys.filePartOfEditSession.bindTo(contextKeyService);
|
|
400
410
|
this.chatSessionHasOptions = ChatContextKeys.chatSessionHasModels.bindTo(contextKeyService);
|
|
@@ -407,6 +417,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
407
417
|
}
|
|
408
418
|
}
|
|
409
419
|
this.chatSessionHasCustomAgentTarget = ChatContextKeys.chatSessionHasCustomAgentTarget.bindTo(contextKeyService);
|
|
420
|
+
this.chatSessionHasTargetedModels = ChatContextKeys.chatSessionHasTargetedModels.bindTo(contextKeyService);
|
|
410
421
|
this.history = this._register(
|
|
411
422
|
this.instantiationService.createInstance(ChatHistoryNavigator, this.location)
|
|
412
423
|
);
|
|
@@ -439,16 +450,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
439
450
|
));
|
|
440
451
|
this._hasFileAttachmentContextKey = ChatContextKeys.hasFileAttachments.bindTo(contextKeyService);
|
|
441
452
|
this.initSelectedModel();
|
|
442
|
-
this._register(this.languageModelsService.onDidChangeLanguageModels(
|
|
443
|
-
this.storageService.store(
|
|
444
|
-
CachedLanguageModelsKey,
|
|
445
|
-
this.storageService.getObject(CachedLanguageModelsKey, StorageScope.APPLICATION, []).filter(m => !m.identifier.startsWith(vendor)),
|
|
446
|
-
StorageScope.APPLICATION,
|
|
447
|
-
StorageTarget.MACHINE
|
|
448
|
-
);
|
|
453
|
+
this._register(this.languageModelsService.onDidChangeLanguageModels(() => {
|
|
449
454
|
const selectedModel = this._currentLanguageModel ? this.getModels().find(m => m.identifier === this._currentLanguageModel.get()?.identifier) : undefined;
|
|
450
|
-
|
|
451
|
-
if (!this.currentLanguageModel || selectedModelNotAvailable) {
|
|
455
|
+
if (!this.currentLanguageModel || !selectedModel) {
|
|
452
456
|
this.setCurrentLanguageModelToDefault();
|
|
453
457
|
}
|
|
454
458
|
}));
|
|
@@ -463,6 +467,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
463
467
|
}));
|
|
464
468
|
this._register(autorun(reader => {
|
|
465
469
|
const lm = this._currentLanguageModel.read(reader);
|
|
470
|
+
this.chatModelIdKey.set(lm?.metadata.id.toLowerCase() ?? "");
|
|
466
471
|
if (lm?.metadata.name) {
|
|
467
472
|
this.accessibilityService.alert(lm.metadata.name);
|
|
468
473
|
}
|
|
@@ -502,7 +507,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
502
507
|
}
|
|
503
508
|
setImplicitContextEnablement() {
|
|
504
509
|
if (this.implicitContext && this.configurationService.getValue("chat.implicitContext.suggestedContext")) {
|
|
505
|
-
this.implicitContext.setEnabled(this._currentModeObservable.get().
|
|
510
|
+
this.implicitContext.setEnabled(this._currentModeObservable.get().name.get().toLowerCase() === "ask");
|
|
506
511
|
}
|
|
507
512
|
}
|
|
508
513
|
setIsWithinEditSession(inInsideDiff, isFilePartOfEditSession) {
|
|
@@ -510,18 +515,22 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
510
515
|
this.filePartOfEditSessionKey.set(isFilePartOfEditSession);
|
|
511
516
|
}
|
|
512
517
|
getSelectedModelStorageKey() {
|
|
518
|
+
const sessionType = this._currentSessionType;
|
|
519
|
+
if (sessionType && this.hasModelsTargetingSessionType()) {
|
|
520
|
+
return `chat.currentLanguageModel.${this.location}.${sessionType}`;
|
|
521
|
+
}
|
|
513
522
|
return `chat.currentLanguageModel.${this.location}`;
|
|
514
523
|
}
|
|
515
524
|
getSelectedModelIsDefaultStorageKey() {
|
|
525
|
+
const sessionType = this._currentSessionType;
|
|
526
|
+
if (sessionType && this.hasModelsTargetingSessionType()) {
|
|
527
|
+
return `chat.currentLanguageModel.${this.location}.${sessionType}.isDefault`;
|
|
528
|
+
}
|
|
516
529
|
return `chat.currentLanguageModel.${this.location}.isDefault`;
|
|
517
530
|
}
|
|
518
531
|
initSelectedModel() {
|
|
519
532
|
const persistedSelection = this.storageService.get(this.getSelectedModelStorageKey(), StorageScope.APPLICATION);
|
|
520
|
-
const persistedAsDefault = this.storageService.getBoolean(
|
|
521
|
-
this.getSelectedModelIsDefaultStorageKey(),
|
|
522
|
-
StorageScope.APPLICATION,
|
|
523
|
-
persistedSelection === "copilot/gpt-4.1"
|
|
524
|
-
);
|
|
533
|
+
const persistedAsDefault = this.storageService.getBoolean(this.getSelectedModelIsDefaultStorageKey(), StorageScope.APPLICATION, true);
|
|
525
534
|
if (persistedSelection) {
|
|
526
535
|
const model = this.getModels().find(m => m.identifier === persistedSelection);
|
|
527
536
|
if (model) {
|
|
@@ -722,7 +731,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
722
731
|
if (state?.selectedModel) {
|
|
723
732
|
const lm = this._currentLanguageModel.get();
|
|
724
733
|
if (!lm || lm.identifier !== state.selectedModel.identifier) {
|
|
725
|
-
this.
|
|
734
|
+
if (this.isModelValidForCurrentSession(state.selectedModel)) {
|
|
735
|
+
this.setCurrentLanguageModel(state.selectedModel);
|
|
736
|
+
} else {
|
|
737
|
+
this.setCurrentLanguageModelToDefault();
|
|
738
|
+
}
|
|
726
739
|
}
|
|
727
740
|
}
|
|
728
741
|
const currentAttachments = this._attachmentModel.attachments;
|
|
@@ -779,7 +792,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
779
792
|
}
|
|
780
793
|
checkModelSupported() {
|
|
781
794
|
const lm = this._currentLanguageModel.get();
|
|
782
|
-
if (lm && (!this.modelSupportedForDefaultAgent(lm) || !this.modelSupportedForInlineChat(lm))) {
|
|
795
|
+
if (lm && (!this.modelSupportedForDefaultAgent(lm) || !this.modelSupportedForInlineChat(lm) || !this.isModelValidForCurrentSession(lm))) {
|
|
783
796
|
this.setCurrentLanguageModelToDefault();
|
|
784
797
|
}
|
|
785
798
|
}
|
|
@@ -812,28 +825,111 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
812
825
|
}
|
|
813
826
|
getModels() {
|
|
814
827
|
const cachedModels = this.storageService.getObject(CachedLanguageModelsKey, StorageScope.APPLICATION, []);
|
|
815
|
-
|
|
828
|
+
const liveModels = ( this.languageModelsService.getLanguageModelIds().map(modelId => ({
|
|
816
829
|
identifier: modelId,
|
|
817
830
|
metadata: this.languageModelsService.lookupLanguageModel(modelId)
|
|
818
831
|
})));
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
832
|
+
let models;
|
|
833
|
+
if (liveModels.length > 0) {
|
|
834
|
+
const liveVendors = ( new Set(( liveModels.map(m => m.metadata.vendor))));
|
|
835
|
+
const contributedVendors = ( new Set(( this.languageModelsService.getVendors().map(v => v.vendor))));
|
|
836
|
+
models = [...liveModels, ...cachedModels.filter(m => !( liveVendors.has(m.metadata.vendor)) && ( contributedVendors.has(m.metadata.vendor)))];
|
|
822
837
|
this.storageService.store(
|
|
823
838
|
CachedLanguageModelsKey,
|
|
824
839
|
models,
|
|
825
840
|
StorageScope.APPLICATION,
|
|
826
841
|
StorageTarget.MACHINE
|
|
827
842
|
);
|
|
843
|
+
} else {
|
|
844
|
+
models = cachedModels;
|
|
828
845
|
}
|
|
829
846
|
models.sort((a, b) => a.metadata.name.localeCompare(b.metadata.name));
|
|
847
|
+
const sessionType = this.getCurrentSessionType();
|
|
848
|
+
if (sessionType && sessionType !== AgentSessionProviders.Local) {
|
|
849
|
+
return models.filter(
|
|
850
|
+
entry => entry.metadata?.targetChatSessionType === sessionType && entry.metadata?.isUserSelectable
|
|
851
|
+
);
|
|
852
|
+
}
|
|
830
853
|
return models.filter(
|
|
831
|
-
entry => entry.metadata?.isUserSelectable && this.modelSupportedForDefaultAgent(entry) && this.modelSupportedForInlineChat(entry)
|
|
854
|
+
entry => !entry.metadata?.targetChatSessionType && entry.metadata?.isUserSelectable && this.modelSupportedForDefaultAgent(entry) && this.modelSupportedForInlineChat(entry)
|
|
832
855
|
);
|
|
833
856
|
}
|
|
857
|
+
getCurrentSessionType() {
|
|
858
|
+
const delegateSessionType = this.options.sessionTypePickerDelegate?.getActiveSessionProvider?.();
|
|
859
|
+
if (delegateSessionType) {
|
|
860
|
+
return delegateSessionType;
|
|
861
|
+
}
|
|
862
|
+
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
863
|
+
const ctx = sessionResource ? this.chatService.getChatSessionFromInternalUri(sessionResource) : undefined;
|
|
864
|
+
return ctx?.chatSessionType;
|
|
865
|
+
}
|
|
866
|
+
hasModelsTargetingSessionType() {
|
|
867
|
+
const sessionType = this.getCurrentSessionType();
|
|
868
|
+
if (!sessionType) {
|
|
869
|
+
return false;
|
|
870
|
+
}
|
|
871
|
+
return ( this.languageModelsService.getLanguageModelIds().some(modelId => {
|
|
872
|
+
const metadata = this.languageModelsService.lookupLanguageModel(modelId);
|
|
873
|
+
return metadata?.targetChatSessionType === sessionType;
|
|
874
|
+
}));
|
|
875
|
+
}
|
|
876
|
+
isModelValidForCurrentSession(model) {
|
|
877
|
+
if (this.hasModelsTargetingSessionType()) {
|
|
878
|
+
return model.metadata.targetChatSessionType === this.getCurrentSessionType();
|
|
879
|
+
}
|
|
880
|
+
return !model.metadata.targetChatSessionType;
|
|
881
|
+
}
|
|
882
|
+
checkModelInSessionPool() {
|
|
883
|
+
const lm = this._currentLanguageModel.get();
|
|
884
|
+
if (lm && !this.isModelValidForCurrentSession(lm)) {
|
|
885
|
+
this.setCurrentLanguageModelToDefault();
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
preselectModelFromSessionHistory() {
|
|
889
|
+
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
890
|
+
const ctx = sessionResource ? this.chatService.getChatSessionFromInternalUri(sessionResource) : undefined;
|
|
891
|
+
const requiresCustomModels = ctx && this.chatSessionsService.requiresCustomModelsForSessionType(ctx.chatSessionType);
|
|
892
|
+
if (!requiresCustomModels) {
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
const requests = this._widget?.viewModel?.model.getRequests();
|
|
896
|
+
if (!requests || requests.length === 0) {
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
let lastModelId;
|
|
900
|
+
for (let i = requests.length - 1; i >= 0; i--) {
|
|
901
|
+
if (requests[i].modelId) {
|
|
902
|
+
lastModelId = requests[i].modelId;
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
if (!lastModelId) {
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
const tryMatch = () => {
|
|
910
|
+
const models = this.getModels();
|
|
911
|
+
let match = models.find(m => m.identifier === lastModelId);
|
|
912
|
+
if (!match) {
|
|
913
|
+
match = models.find(m => m.metadata.id === lastModelId);
|
|
914
|
+
}
|
|
915
|
+
return match;
|
|
916
|
+
};
|
|
917
|
+
const match = tryMatch();
|
|
918
|
+
if (match) {
|
|
919
|
+
this.setCurrentLanguageModel(match);
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
this._waitForPersistedLanguageModel.value = this.languageModelsService.onDidChangeLanguageModels(() => {
|
|
923
|
+
const found = tryMatch();
|
|
924
|
+
if (found) {
|
|
925
|
+
this._waitForPersistedLanguageModel.clear();
|
|
926
|
+
this.setCurrentLanguageModel(found);
|
|
927
|
+
}
|
|
928
|
+
});
|
|
929
|
+
}
|
|
834
930
|
setCurrentLanguageModelToDefault() {
|
|
835
931
|
const allModels = this.getModels();
|
|
836
|
-
const defaultModel = allModels.find(m => m.metadata.isDefaultForLocation[this.location]) || allModels
|
|
932
|
+
const defaultModel = allModels.find(m => m.metadata.isDefaultForLocation[this.location]) || allModels[0];
|
|
837
933
|
if (defaultModel) {
|
|
838
934
|
this.setCurrentLanguageModel(defaultModel);
|
|
839
935
|
}
|
|
@@ -864,40 +960,40 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
864
960
|
}
|
|
865
961
|
const mode = this._currentModeObservable.get();
|
|
866
962
|
const modelName = this._currentLanguageModel.get()?.metadata.name;
|
|
867
|
-
const modelInfo = modelName ? ( localize(
|
|
963
|
+
const modelInfo = modelName ? ( localize(6689, ", {0}. ", modelName)) : "";
|
|
868
964
|
let modeLabel = "";
|
|
869
965
|
if (!mode.isBuiltin) {
|
|
870
966
|
const mode = this.currentModeObs.get();
|
|
871
|
-
modeLabel = ( localize(
|
|
967
|
+
modeLabel = ( localize(6690, "({0}), {1}", mode.label.get(), mode.description.get()));
|
|
872
968
|
} else {
|
|
873
969
|
switch (this.currentModeKind) {
|
|
874
970
|
case ChatModeKind.Agent:
|
|
875
|
-
modeLabel = ( localize(
|
|
971
|
+
modeLabel = ( localize(6691, "(Agent), edit files in your workspace."));
|
|
876
972
|
break;
|
|
877
973
|
case ChatModeKind.Edit:
|
|
878
|
-
modeLabel = ( localize(
|
|
974
|
+
modeLabel = ( localize(6692, "(Edit), edit files in your workspace."));
|
|
879
975
|
break;
|
|
880
976
|
case ChatModeKind.Ask:
|
|
881
977
|
default:
|
|
882
|
-
modeLabel = ( localize(
|
|
978
|
+
modeLabel = ( localize(6693, "(Ask), ask questions or type / for topics."));
|
|
883
979
|
break;
|
|
884
980
|
}
|
|
885
981
|
}
|
|
886
982
|
if (verbose) {
|
|
887
983
|
return kbLabel ? ( localize(
|
|
888
|
-
|
|
984
|
+
6694,
|
|
889
985
|
"Chat Input {0}{1} Press Enter to send out the request. Use {2} for Chat Accessibility Help.",
|
|
890
986
|
modeLabel,
|
|
891
987
|
modelInfo,
|
|
892
988
|
kbLabel
|
|
893
989
|
)) : ( localize(
|
|
894
|
-
|
|
990
|
+
6695,
|
|
895
991
|
"Chat Input {0}{1} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.",
|
|
896
992
|
modeLabel,
|
|
897
993
|
modelInfo
|
|
898
994
|
));
|
|
899
995
|
} else {
|
|
900
|
-
return localize(
|
|
996
|
+
return localize(6696, "Chat Input {0}{1}.", modeLabel, modelInfo);
|
|
901
997
|
}
|
|
902
998
|
}
|
|
903
999
|
validateCurrentChatMode() {
|
|
@@ -1028,6 +1124,15 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1028
1124
|
hasFocus() {
|
|
1029
1125
|
return this._inputEditor.hasWidgetFocus();
|
|
1030
1126
|
}
|
|
1127
|
+
focusTodoList() {
|
|
1128
|
+
return this._chatInputTodoListWidget.value?.focus() ?? false;
|
|
1129
|
+
}
|
|
1130
|
+
isTodoListFocused() {
|
|
1131
|
+
return this._chatInputTodoListWidget.value?.hasFocus() ?? false;
|
|
1132
|
+
}
|
|
1133
|
+
hasVisibleTodos() {
|
|
1134
|
+
return this._chatInputTodoListWidget.value?.hasTodos() ?? false;
|
|
1135
|
+
}
|
|
1031
1136
|
async acceptInput(isUserQuery) {
|
|
1032
1137
|
if (isUserQuery) {
|
|
1033
1138
|
const userQuery = this.getCurrentInputState();
|
|
@@ -1130,6 +1235,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1130
1235
|
const ctx = sessionResource ? this.chatService.getChatSessionFromInternalUri(sessionResource) : undefined;
|
|
1131
1236
|
const customAgentTarget = ctx && this.chatSessionsService.getCustomAgentTargetForSessionType(ctx.chatSessionType);
|
|
1132
1237
|
this.chatSessionHasCustomAgentTarget.set(customAgentTarget !== Target.Undefined);
|
|
1238
|
+
const requiresCustomModels = ctx && this.chatSessionsService.requiresCustomModelsForSessionType(ctx.chatSessionType);
|
|
1239
|
+
this.chatSessionHasTargetedModels.set(!!requiresCustomModels);
|
|
1133
1240
|
if (customAgentTarget) {
|
|
1134
1241
|
const agentOption = this.chatSessionsService.getSessionOption(ctx.chatSessionResource, agentOptionId);
|
|
1135
1242
|
if (typeof agentOption !== "undefined") {
|
|
@@ -1321,6 +1428,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1321
1428
|
this._widgetController.value = this.instantiationService.createInstance(ChatInputPartWidgetController, this.chatInputWidgetsContainer);
|
|
1322
1429
|
}
|
|
1323
1430
|
}
|
|
1431
|
+
showContextUsageDetails() {
|
|
1432
|
+
return this.contextUsageWidget?.showDetails() ?? false;
|
|
1433
|
+
}
|
|
1324
1434
|
updateContextUsageWidget() {
|
|
1325
1435
|
this._contextUsageDisposables.clear();
|
|
1326
1436
|
const model = this._widget?.viewModel?.model;
|
|
@@ -1330,7 +1440,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1330
1440
|
const store = ( new DisposableStore());
|
|
1331
1441
|
this._contextUsageDisposables.value = store;
|
|
1332
1442
|
store.add(model.onDidChange(e => {
|
|
1333
|
-
if (e.kind === "completedRequest") {
|
|
1443
|
+
if (e.kind === "addRequest" || e.kind === "completedRequest") {
|
|
1334
1444
|
this.contextUsageWidget?.update(model.lastRequest);
|
|
1335
1445
|
}
|
|
1336
1446
|
}));
|
|
@@ -1346,13 +1456,22 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1346
1456
|
this.updateWidgetLockStateFromSessionType(initialSessionType);
|
|
1347
1457
|
}
|
|
1348
1458
|
}
|
|
1349
|
-
this._register(widget.onDidChangeViewModel(
|
|
1459
|
+
this._register(widget.onDidChangeViewModel(e => {
|
|
1350
1460
|
this._pendingDelegationTarget = undefined;
|
|
1351
1461
|
this.updateAgentSessionTypeContextKey();
|
|
1352
1462
|
this.refreshChatSessionPickers();
|
|
1353
1463
|
this.tryUpdateWidgetController();
|
|
1354
1464
|
this.updateContextUsageWidget();
|
|
1355
|
-
this.
|
|
1465
|
+
if (this._currentQuestionCarouselSessionResource && (!e.currentSessionResource || !isEqual(this._currentQuestionCarouselSessionResource, e.currentSessionResource))) {
|
|
1466
|
+
this.clearQuestionCarousel();
|
|
1467
|
+
}
|
|
1468
|
+
const newSessionType = this.getCurrentSessionType();
|
|
1469
|
+
if (newSessionType !== this._currentSessionType) {
|
|
1470
|
+
this._currentSessionType = newSessionType;
|
|
1471
|
+
this.initSelectedModel();
|
|
1472
|
+
}
|
|
1473
|
+
this.checkModelInSessionPool();
|
|
1474
|
+
this.preselectModelFromSessionHistory();
|
|
1356
1475
|
}));
|
|
1357
1476
|
let elements;
|
|
1358
1477
|
if (this.options.renderStyle === "compact") {
|
|
@@ -1361,18 +1480,18 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1361
1480
|
h(".chat-input-widgets-container@chatInputWidgetsContainer"),
|
|
1362
1481
|
h(".chat-todo-list-widget-container@chatInputTodoListWidgetContainer"),
|
|
1363
1482
|
h(".chat-editing-session@chatEditingSessionWidgetContainer"),
|
|
1483
|
+
h(".chat-getting-started-tip-container@chatGettingStartedTipContainer"),
|
|
1484
|
+
h(".interactive-input-and-side-toolbar@inputAndSideToolbar", [h(
|
|
1485
|
+
".chat-input-container@inputContainer",
|
|
1486
|
+
[h(".chat-editor-container@editorContainer"), h(
|
|
1487
|
+
".chat-input-toolbars@inputToolbars",
|
|
1488
|
+
[h(".chat-context-usage-container@contextUsageWidgetContainer")]
|
|
1489
|
+
)]
|
|
1490
|
+
)]),
|
|
1364
1491
|
h(
|
|
1365
|
-
".
|
|
1366
|
-
[h(".chat-
|
|
1367
|
-
h(".chat-context-usage-container@contextUsageWidgetContainer"),
|
|
1368
|
-
h(".chat-editor-container@editorContainer"),
|
|
1369
|
-
h(".chat-input-toolbars@inputToolbars")
|
|
1370
|
-
])]
|
|
1492
|
+
".chat-attachments-container@attachmentsContainer",
|
|
1493
|
+
[h(".chat-attached-context@attachedContextContainer")]
|
|
1371
1494
|
),
|
|
1372
|
-
h(".chat-attachments-container@attachmentsContainer", [
|
|
1373
|
-
h(".chat-attachment-toolbar@attachmentToolbar"),
|
|
1374
|
-
h(".chat-attached-context@attachedContextContainer")
|
|
1375
|
-
]),
|
|
1376
1495
|
h(".interactive-input-followups@followupsContainer")
|
|
1377
1496
|
])]);
|
|
1378
1497
|
} else {
|
|
@@ -1382,17 +1501,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1382
1501
|
h(".chat-input-widgets-container@chatInputWidgetsContainer"),
|
|
1383
1502
|
h(".chat-todo-list-widget-container@chatInputTodoListWidgetContainer"),
|
|
1384
1503
|
h(".chat-editing-session@chatEditingSessionWidgetContainer"),
|
|
1504
|
+
h(".chat-getting-started-tip-container@chatGettingStartedTipContainer"),
|
|
1385
1505
|
h(
|
|
1386
1506
|
".interactive-input-and-side-toolbar@inputAndSideToolbar",
|
|
1387
|
-
[h(".chat-input-container@inputContainer", [
|
|
1388
|
-
|
|
1389
|
-
h(".chat-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
]
|
|
1393
|
-
|
|
1394
|
-
h(".chat-input-toolbars@inputToolbars")
|
|
1395
|
-
])]
|
|
1507
|
+
[h(".chat-input-container@inputContainer", [h(
|
|
1508
|
+
".chat-attachments-container@attachmentsContainer",
|
|
1509
|
+
[h(".chat-attached-context@attachedContextContainer")]
|
|
1510
|
+
), h(".chat-editor-container@editorContainer"), h(
|
|
1511
|
+
".chat-input-toolbars@inputToolbars",
|
|
1512
|
+
[h(".chat-context-usage-container@contextUsageWidgetContainer")]
|
|
1513
|
+
)])]
|
|
1396
1514
|
)
|
|
1397
1515
|
]);
|
|
1398
1516
|
}
|
|
@@ -1405,13 +1523,15 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1405
1523
|
this.followupsContainer = elements.followupsContainer;
|
|
1406
1524
|
const inputAndSideToolbar = elements.inputAndSideToolbar;
|
|
1407
1525
|
const inputContainer = elements.inputContainer;
|
|
1526
|
+
this.inputContainer = inputContainer;
|
|
1408
1527
|
const editorContainer = elements.editorContainer;
|
|
1409
1528
|
this.attachmentsContainer = elements.attachmentsContainer;
|
|
1410
1529
|
this.attachedContextContainer = elements.attachedContextContainer;
|
|
1411
1530
|
const toolbarsContainer = elements.inputToolbars;
|
|
1412
|
-
const attachmentToolbarContainer = elements.attachmentToolbar;
|
|
1413
1531
|
this.chatEditingSessionWidgetContainer = elements.chatEditingSessionWidgetContainer;
|
|
1414
1532
|
this.chatInputTodoListWidgetContainer = elements.chatInputTodoListWidgetContainer;
|
|
1533
|
+
this.chatGettingStartedTipContainer = elements.chatGettingStartedTipContainer;
|
|
1534
|
+
this.chatGettingStartedTipContainer.style.display = "none";
|
|
1415
1535
|
this.chatQuestionCarouselContainer = elements.chatQuestionCarouselContainer;
|
|
1416
1536
|
this.chatInputWidgetsContainer = elements.chatInputWidgetsContainer;
|
|
1417
1537
|
this.contextUsageWidgetContainer = elements.contextUsageWidgetContainer;
|
|
@@ -1608,9 +1728,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1608
1728
|
this.setCurrentLanguageModel(model);
|
|
1609
1729
|
this.renderAttachedContext();
|
|
1610
1730
|
},
|
|
1611
|
-
getModels: () => this.getModels()
|
|
1731
|
+
getModels: () => this.getModels(),
|
|
1732
|
+
canManageModels: () => {
|
|
1733
|
+
const sessionType = this.getCurrentSessionType();
|
|
1734
|
+
return !sessionType || sessionType === localChatSessionType;
|
|
1735
|
+
}
|
|
1612
1736
|
};
|
|
1613
|
-
return this.modelWidget = this.instantiationService.createInstance(
|
|
1737
|
+
return this.modelWidget = this.instantiationService.createInstance(EnhancedModelPickerActionItem, action, itemDelegate, pickerOptions);
|
|
1614
1738
|
} else if (action.id === OpenModePickerAction.ID && action instanceof MenuItemAction) {
|
|
1615
1739
|
const delegate = {
|
|
1616
1740
|
currentMode: this._currentModeObservable,
|
|
@@ -1779,43 +1903,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1779
1903
|
this._register(this.themeService.onDidFileIconThemeChange(() => {
|
|
1780
1904
|
this.renderAttachedContext();
|
|
1781
1905
|
}));
|
|
1782
|
-
this.addFilesToolbar = this._register(this.instantiationService.createInstance(
|
|
1783
|
-
MenuWorkbenchToolBar,
|
|
1784
|
-
attachmentToolbarContainer,
|
|
1785
|
-
MenuId.ChatInputAttachmentToolbar,
|
|
1786
|
-
{
|
|
1787
|
-
telemetrySource: this.options.menus.telemetrySource,
|
|
1788
|
-
label: true,
|
|
1789
|
-
menuOptions: {
|
|
1790
|
-
shouldForwardArgs: true,
|
|
1791
|
-
renderShortTitle: true
|
|
1792
|
-
},
|
|
1793
|
-
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
1794
|
-
hoverDelegate,
|
|
1795
|
-
actionViewItemProvider: (action, options) => {
|
|
1796
|
-
if (action.id === "workbench.action.chat.attachContext") {
|
|
1797
|
-
const viewItem = this.instantiationService.createInstance(AddFilesButton, this._attachmentModel, action, options);
|
|
1798
|
-
viewItem.setShowLabel(
|
|
1799
|
-
this._attachmentModel.size === 0 && !this._implicitContextWidget.value?.hasRenderedContexts
|
|
1800
|
-
);
|
|
1801
|
-
this.addFilesButton = viewItem;
|
|
1802
|
-
return this.addFilesButton;
|
|
1803
|
-
}
|
|
1804
|
-
return undefined;
|
|
1805
|
-
}
|
|
1806
|
-
}
|
|
1807
|
-
));
|
|
1808
|
-
this.addFilesToolbar.context = {
|
|
1809
|
-
widget,
|
|
1810
|
-
placeholder: ( localize(6163, "Search for files and context to add to your request"))
|
|
1811
|
-
};
|
|
1812
1906
|
this.renderAttachedContext();
|
|
1813
1907
|
const inputResizeObserver = this._register(new DisposableResizeObserver(() => {
|
|
1814
1908
|
const newHeight = this.container.offsetHeight;
|
|
1815
1909
|
this.height.set(newHeight, undefined);
|
|
1816
1910
|
}));
|
|
1817
1911
|
this._register(inputResizeObserver.observe(this.container));
|
|
1818
|
-
if (this.options.renderStyle === "compact"
|
|
1912
|
+
if (this.options.renderStyle === "compact") {
|
|
1819
1913
|
const toolbarsResizeObserver = this._register(new DisposableResizeObserver(() => {
|
|
1820
1914
|
if (this.cachedWidth) {
|
|
1821
1915
|
this.layout(this.cachedWidth);
|
|
@@ -1847,16 +1941,47 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1847
1941
|
})
|
|
1848
1942
|
);
|
|
1849
1943
|
const attachments = [...this.attachmentModel.attachments.entries()];
|
|
1850
|
-
const hasAttachments = Boolean(attachments.length)
|
|
1944
|
+
const hasAttachments = Boolean(attachments.length);
|
|
1945
|
+
let hasImplicitContext = false;
|
|
1946
|
+
const isSuggestedEnabled = this.configurationService.getValue("chat.implicitContext.suggestedContext");
|
|
1947
|
+
const hasVisibleImplicitContext = isSuggestedEnabled ? this._implicitContext?.hasValue ?? false : this._implicitContext?.values.some(v => v.enabled || v.isSelection) ?? false;
|
|
1948
|
+
if (this._implicitContext && hasVisibleImplicitContext) {
|
|
1949
|
+
const isAttachmentAlreadyAttached = (targetUri, targetRange, targetHandle) => {
|
|
1950
|
+
return ( this._attachmentModel.attachments.some(a => {
|
|
1951
|
+
const aUri = URI.isUri(a.value) ? a.value : isLocation(a.value) ? a.value.uri : undefined;
|
|
1952
|
+
const aRange = isLocation(a.value) ? a.value.range : undefined;
|
|
1953
|
+
if (targetHandle !== undefined && isStringVariableEntry(a) && a.handle === targetHandle) {
|
|
1954
|
+
return true;
|
|
1955
|
+
}
|
|
1956
|
+
if (targetUri && aUri && isEqual(targetUri, aUri)) {
|
|
1957
|
+
if (targetRange && aRange) {
|
|
1958
|
+
return Range.equalsRange(targetRange, aRange);
|
|
1959
|
+
}
|
|
1960
|
+
return !targetRange && !aRange;
|
|
1961
|
+
}
|
|
1962
|
+
return false;
|
|
1963
|
+
}));
|
|
1964
|
+
};
|
|
1965
|
+
const implicitContextWidget = this.instantiationService.createInstance(
|
|
1966
|
+
ImplicitContextAttachmentWidget,
|
|
1967
|
+
() => this._widget,
|
|
1968
|
+
isAttachmentAlreadyAttached,
|
|
1969
|
+
this._implicitContext,
|
|
1970
|
+
this._contextResourceLabels,
|
|
1971
|
+
this._attachmentModel,
|
|
1972
|
+
container
|
|
1973
|
+
);
|
|
1974
|
+
store.add(implicitContextWidget);
|
|
1975
|
+
hasImplicitContext = implicitContextWidget.hasRenderedContexts;
|
|
1976
|
+
}
|
|
1851
1977
|
setVisibility(Boolean(
|
|
1852
|
-
this.options.renderInputToolbarBelowInput || hasAttachments ||
|
|
1978
|
+
this.options.renderInputToolbarBelowInput || hasAttachments || hasImplicitContext
|
|
1853
1979
|
), this.attachmentsContainer);
|
|
1854
|
-
setVisibility(hasAttachments, this.attachedContextContainer);
|
|
1980
|
+
setVisibility(hasAttachments || hasImplicitContext, this.attachedContextContainer);
|
|
1855
1981
|
if (!attachments.length) {
|
|
1856
1982
|
this._indexOfLastAttachedContextDeletedWithKeyboard = -1;
|
|
1857
1983
|
this._indexOfLastOpenedContext = -1;
|
|
1858
1984
|
}
|
|
1859
|
-
const isSuggestedEnabled = this.configurationService.getValue("chat.implicitContext.suggestedContext");
|
|
1860
1985
|
for (const [index, attachment] of attachments) {
|
|
1861
1986
|
const resource = URI.isUri(attachment.value) ? attachment.value : isLocation(attachment.value) ? attachment.value.uri : undefined;
|
|
1862
1987
|
const range = isLocation(attachment.value) ? attachment.value.range : undefined;
|
|
@@ -1984,7 +2109,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1984
2109
|
this._contextResourceLabels
|
|
1985
2110
|
);
|
|
1986
2111
|
} else {
|
|
1987
|
-
attachmentWidget = this.instantiationService.createInstance(
|
|
2112
|
+
attachmentWidget = this._chatAttachmentWidgetRegistry.createWidget(attachment, options, container) ?? this.instantiationService.createInstance(
|
|
1988
2113
|
DefaultChatAttachmentWidget,
|
|
1989
2114
|
resource,
|
|
1990
2115
|
range,
|
|
@@ -2010,53 +2135,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2010
2135
|
this.handleAttachmentOpen(index, attachment);
|
|
2011
2136
|
}));
|
|
2012
2137
|
}
|
|
2013
|
-
if (isSuggestedEnabled && this.implicitContext?.hasValue) {
|
|
2014
|
-
this._implicitContextWidget.value = this.instantiationService.createInstance(
|
|
2015
|
-
ImplicitContextAttachmentWidget,
|
|
2016
|
-
() => this._widget,
|
|
2017
|
-
(targetUri, targetRange, targetHandle) => this.isAttachmentAlreadyAttached(targetUri, targetRange, targetHandle, ( attachments.map(([, a]) => a))),
|
|
2018
|
-
this.implicitContext,
|
|
2019
|
-
this._contextResourceLabels,
|
|
2020
|
-
this._attachmentModel,
|
|
2021
|
-
container
|
|
2022
|
-
);
|
|
2023
|
-
} else {
|
|
2024
|
-
this._implicitContextWidget.clear();
|
|
2025
|
-
}
|
|
2026
|
-
this.addFilesButton?.setShowLabel(
|
|
2027
|
-
this._attachmentModel.size === 0 && !this._implicitContextWidget.value?.hasRenderedContexts
|
|
2028
|
-
);
|
|
2029
2138
|
this._indexOfLastOpenedContext = -1;
|
|
2030
2139
|
}
|
|
2031
|
-
isAttachmentAlreadyAttached(targetUri, targetRange, targetHandle, attachments) {
|
|
2032
|
-
return ( attachments.some(attachment => {
|
|
2033
|
-
let uri;
|
|
2034
|
-
let range;
|
|
2035
|
-
let handle;
|
|
2036
|
-
if (URI.isUri(attachment.value)) {
|
|
2037
|
-
uri = attachment.value;
|
|
2038
|
-
} else if (isLocation(attachment.value)) {
|
|
2039
|
-
uri = attachment.value.uri;
|
|
2040
|
-
range = attachment.value.range;
|
|
2041
|
-
} else if (isStringVariableEntry(attachment)) {
|
|
2042
|
-
uri = attachment.uri;
|
|
2043
|
-
handle = attachment.handle;
|
|
2044
|
-
}
|
|
2045
|
-
if ((handle !== undefined && targetHandle === undefined) || (handle === undefined && targetHandle !== undefined)) {
|
|
2046
|
-
return false;
|
|
2047
|
-
}
|
|
2048
|
-
if (handle !== undefined && targetHandle !== undefined && handle !== targetHandle) {
|
|
2049
|
-
return false;
|
|
2050
|
-
}
|
|
2051
|
-
if (!uri || !isEqual(uri, targetUri)) {
|
|
2052
|
-
return false;
|
|
2053
|
-
}
|
|
2054
|
-
if (targetRange) {
|
|
2055
|
-
return range && Range.equalsRange(range, targetRange);
|
|
2056
|
-
}
|
|
2057
|
-
return true;
|
|
2058
|
-
}));
|
|
2059
|
-
}
|
|
2060
2140
|
handleAttachmentDeletion(e, index, attachment) {
|
|
2061
2141
|
if (isKeyboardEvent(e)) {
|
|
2062
2142
|
this._indexOfLastAttachedContextDeletedWithKeyboard = index;
|
|
@@ -2089,17 +2169,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2089
2169
|
if (!e.equals(KeyCode.LeftArrow) && !e.equals(KeyCode.RightArrow)) {
|
|
2090
2170
|
return;
|
|
2091
2171
|
}
|
|
2092
|
-
const toolbar = this.addFilesToolbar?.getElement().querySelector(".action-label");
|
|
2093
|
-
if (!toolbar) {
|
|
2094
|
-
return;
|
|
2095
|
-
}
|
|
2096
2172
|
const attachments = Array.from(
|
|
2097
2173
|
this.attachedContextContainer.querySelectorAll(".chat-attached-context-attachment")
|
|
2098
2174
|
);
|
|
2099
2175
|
if (!attachments.length) {
|
|
2100
2176
|
return;
|
|
2101
2177
|
}
|
|
2102
|
-
attachments.unshift(toolbar);
|
|
2103
2178
|
const activeElement = getActiveElement(getWindow(this.attachmentsContainer).document);
|
|
2104
2179
|
const currentIndex = attachments.findIndex(attachment => attachment === activeElement);
|
|
2105
2180
|
let newIndex = currentIndex;
|
|
@@ -2138,13 +2213,21 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2138
2213
|
if (existingResolveId && carousel.resolveId && existingResolveId === carousel.resolveId) {
|
|
2139
2214
|
return existingCarousel;
|
|
2140
2215
|
}
|
|
2216
|
+
const oldCarousel = existingCarousel.carousel;
|
|
2217
|
+
if (oldCarousel instanceof ChatQuestionCarouselData && !oldCarousel.completion.isSettled) {
|
|
2218
|
+
oldCarousel.completion.complete({
|
|
2219
|
+
answers: undefined
|
|
2220
|
+
});
|
|
2221
|
+
}
|
|
2141
2222
|
this.clearQuestionCarousel();
|
|
2142
2223
|
}
|
|
2143
2224
|
this._currentQuestionCarouselResponseId = isResponseVM(context.element) ? context.element.requestId : undefined;
|
|
2225
|
+
this._currentQuestionCarouselSessionResource = isResponseVM(context.element) ? context.element.sessionResource : undefined;
|
|
2144
2226
|
const part = this._chatQuestionCarouselDisposables.add(
|
|
2145
2227
|
this.instantiationService.createInstance(ChatQuestionCarouselPart, carousel, context, options)
|
|
2146
2228
|
);
|
|
2147
2229
|
this._chatQuestionCarouselWidget.value = part;
|
|
2230
|
+
this._hasQuestionCarouselContextKey?.set(true);
|
|
2148
2231
|
clearNode(this.chatQuestionCarouselContainer);
|
|
2149
2232
|
append(this.chatQuestionCarouselContainer, part.domNode);
|
|
2150
2233
|
return part;
|
|
@@ -2156,6 +2239,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2156
2239
|
this._chatQuestionCarouselDisposables.clear();
|
|
2157
2240
|
this._chatQuestionCarouselWidget.clear();
|
|
2158
2241
|
this._currentQuestionCarouselResponseId = undefined;
|
|
2242
|
+
this._currentQuestionCarouselSessionResource = undefined;
|
|
2243
|
+
this._hasQuestionCarouselContextKey?.set(false);
|
|
2159
2244
|
clearNode(this.chatQuestionCarouselContainer);
|
|
2160
2245
|
}
|
|
2161
2246
|
get questionCarouselResponseId() {
|
|
@@ -2164,6 +2249,26 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2164
2249
|
get questionCarousel() {
|
|
2165
2250
|
return this._chatQuestionCarouselWidget.value;
|
|
2166
2251
|
}
|
|
2252
|
+
focusQuestionCarousel() {
|
|
2253
|
+
const carousel = this._chatQuestionCarouselWidget.value;
|
|
2254
|
+
if (carousel) {
|
|
2255
|
+
carousel.focus();
|
|
2256
|
+
return true;
|
|
2257
|
+
}
|
|
2258
|
+
return false;
|
|
2259
|
+
}
|
|
2260
|
+
isQuestionCarouselFocused() {
|
|
2261
|
+
const carousel = this._chatQuestionCarouselWidget.value;
|
|
2262
|
+
return carousel?.hasFocus() ?? false;
|
|
2263
|
+
}
|
|
2264
|
+
navigateToPreviousQuestion() {
|
|
2265
|
+
const carousel = this._chatQuestionCarouselWidget.value;
|
|
2266
|
+
return carousel?.navigateToPreviousQuestion() ?? false;
|
|
2267
|
+
}
|
|
2268
|
+
navigateToNextQuestion() {
|
|
2269
|
+
const carousel = this._chatQuestionCarouselWidget.value;
|
|
2270
|
+
return carousel?.navigateToNextQuestion() ?? false;
|
|
2271
|
+
}
|
|
2167
2272
|
setWorkingSetCollapsed(collapsed) {
|
|
2168
2273
|
this._workingSetCollapsed.set(collapsed, undefined);
|
|
2169
2274
|
}
|
|
@@ -2281,7 +2386,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2281
2386
|
const button = this._chatEditsActionsDisposables.add(( new ButtonWithIcon(overviewTitle, {
|
|
2282
2387
|
supportIcons: true,
|
|
2283
2388
|
secondary: true,
|
|
2284
|
-
ariaLabel: ( localize(
|
|
2389
|
+
ariaLabel: ( localize(6697, "Toggle changed files."))
|
|
2285
2390
|
})));
|
|
2286
2391
|
const topLevelStats = derived(reader => {
|
|
2287
2392
|
const entries = editSessionEntriesObs.read(reader);
|
|
@@ -2323,12 +2428,17 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2323
2428
|
{
|
|
2324
2429
|
telemetrySource: this.options.menus.telemetrySource,
|
|
2325
2430
|
small: true,
|
|
2326
|
-
menuOptions: {
|
|
2327
|
-
|
|
2431
|
+
menuOptions: sessionResource ? (isSessionMenu ? {
|
|
2432
|
+
args: [
|
|
2433
|
+
sessionResource,
|
|
2434
|
+
this.agentSessionsService.getSession(sessionResource)?.metadata
|
|
2435
|
+
]
|
|
2436
|
+
} : {
|
|
2437
|
+
arg: {
|
|
2328
2438
|
$mid: MarshalledId.ChatViewContext,
|
|
2329
2439
|
sessionResource
|
|
2330
|
-
}
|
|
2331
|
-
},
|
|
2440
|
+
}
|
|
2441
|
+
}) : undefined,
|
|
2332
2442
|
disableWhileRunning: isSessionMenu,
|
|
2333
2443
|
buttonConfigProvider: action => {
|
|
2334
2444
|
if (action.id === ChatEditingShowChangesAction.ID || action.id === ViewPreviousEditsAction.Id || action.id === ViewAllSessionChangesAction.ID) {
|
|
@@ -2350,10 +2460,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2350
2460
|
removed,
|
|
2351
2461
|
shouldShowEditingSession
|
|
2352
2462
|
} = topLevelStats.read(reader);
|
|
2353
|
-
const buttonLabel = files === 1 ? ( localize(
|
|
2463
|
+
const buttonLabel = files === 1 ? ( localize(6698, "1 file changed")) : ( localize(6699, "{0} files changed", files));
|
|
2354
2464
|
button.label = buttonLabel;
|
|
2355
2465
|
button.element.setAttribute("aria-label", ( localize(
|
|
2356
|
-
|
|
2466
|
+
6700,
|
|
2357
2467
|
"{0}, {1} lines added, {2} lines removed",
|
|
2358
2468
|
buttonLabel,
|
|
2359
2469
|
added,
|
|
@@ -2497,7 +2607,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2497
2607
|
const inputToolbarWidth = this.cachedInputToolbarWidth = this.inputActionsToolbar.getItemsWidth();
|
|
2498
2608
|
const executeToolbarPadding = (this.executeToolbar.getItemsLength() - 1) * 4;
|
|
2499
2609
|
const inputToolbarPadding = this.inputActionsToolbar.getItemsLength() ? (this.inputActionsToolbar.getItemsLength() - 1) * 4 : 0;
|
|
2500
|
-
|
|
2610
|
+
const contextUsageWidth = getTotalWidth(this.contextUsageWidgetContainer);
|
|
2611
|
+
const inputToolbarsPadding = 12;
|
|
2612
|
+
return executeToolbarWidth + executeToolbarPadding + contextUsageWidth + (this.options.renderInputToolbarBelowInput ? 0 : inputToolbarWidth + inputToolbarPadding + inputToolbarsPadding);
|
|
2501
2613
|
};
|
|
2502
2614
|
return {
|
|
2503
2615
|
editorBorder: 2,
|
|
@@ -2542,7 +2654,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2542
2654
|
};
|
|
2543
2655
|
}
|
|
2544
2656
|
};
|
|
2545
|
-
ChatInputPart = ChatInputPart_1 = ( __decorate([( __param(4, IModelService)), ( __param(5, IInstantiationService)), ( __param(6, IContextKeyService)), ( __param(7, IConfigurationService)), ( __param(8, IKeybindingService)), ( __param(9, IAccessibilityService)), ( __param(10, ILanguageModelsService)), ( __param(11, ILogService)), ( __param(12, IFileService)), ( __param(13, IEditorService)), ( __param(14, IThemeService)), ( __param(15, ITextModelService)), ( __param(16, IStorageService)), ( __param(17, IChatAgentService)), ( __param(18, ISharedWebContentExtractorService)), ( __param(19, IWorkbenchAssignmentService)), ( __param(20, IChatEntitlementService)), ( __param(21, IChatModeService)), ( __param(22, ILanguageModelToolsService)), ( __param(23, IChatService)), ( __param(24, IChatSessionsService)), ( __param(25, IChatContextService)), ( __param(26, IAgentSessionsService)), ( __param(27, IWorkspaceContextService)), ( __param(28, IWorkbenchLayoutService)), ( __param(29, IViewDescriptorService))], ChatInputPart));
|
|
2657
|
+
ChatInputPart = ChatInputPart_1 = ( __decorate([( __param(4, IModelService)), ( __param(5, IInstantiationService)), ( __param(6, IContextKeyService)), ( __param(7, IConfigurationService)), ( __param(8, IKeybindingService)), ( __param(9, IAccessibilityService)), ( __param(10, ILanguageModelsService)), ( __param(11, ILogService)), ( __param(12, IFileService)), ( __param(13, IEditorService)), ( __param(14, IThemeService)), ( __param(15, ITextModelService)), ( __param(16, IStorageService)), ( __param(17, IChatAgentService)), ( __param(18, ISharedWebContentExtractorService)), ( __param(19, IWorkbenchAssignmentService)), ( __param(20, IChatEntitlementService)), ( __param(21, IChatModeService)), ( __param(22, ILanguageModelToolsService)), ( __param(23, IChatService)), ( __param(24, IChatSessionsService)), ( __param(25, IChatContextService)), ( __param(26, IAgentSessionsService)), ( __param(27, IWorkspaceContextService)), ( __param(28, IWorkbenchLayoutService)), ( __param(29, IViewDescriptorService)), ( __param(30, IChatAttachmentWidgetRegistry))], ChatInputPart));
|
|
2546
2658
|
function getLastPosition(model) {
|
|
2547
2659
|
return {
|
|
2548
2660
|
lineNumber: model.getLineCount(),
|
|
@@ -2571,33 +2683,5 @@ class ChatSessionPickersContainerActionItem extends ActionViewItem {
|
|
|
2571
2683
|
super.dispose();
|
|
2572
2684
|
}
|
|
2573
2685
|
}
|
|
2574
|
-
class AddFilesButton extends ActionViewItem {
|
|
2575
|
-
constructor(context, action, options) {
|
|
2576
|
-
super(context, action, {
|
|
2577
|
-
...options,
|
|
2578
|
-
icon: false,
|
|
2579
|
-
label: true,
|
|
2580
|
-
keybindingNotRenderedWithLabel: true
|
|
2581
|
-
});
|
|
2582
|
-
}
|
|
2583
|
-
setShowLabel(show) {
|
|
2584
|
-
this.showLabel = show;
|
|
2585
|
-
this.updateLabel();
|
|
2586
|
-
}
|
|
2587
|
-
render(container) {
|
|
2588
|
-
container.classList.add("chat-attachment-button");
|
|
2589
|
-
super.render(container);
|
|
2590
|
-
this.updateLabel();
|
|
2591
|
-
}
|
|
2592
|
-
updateLabel() {
|
|
2593
|
-
if (!this.label) {
|
|
2594
|
-
return;
|
|
2595
|
-
}
|
|
2596
|
-
assertType(this.label);
|
|
2597
|
-
this.label.classList.toggle("has-label", this.showLabel);
|
|
2598
|
-
const message = this.showLabel ? `$(attach) ${this.action.label}` : `$(attach)`;
|
|
2599
|
-
reset(this.label, ...renderLabelWithIcons(message));
|
|
2600
|
-
}
|
|
2601
|
-
}
|
|
2602
2686
|
|
|
2603
2687
|
export { ChatInputPart, ChatWidgetLocation };
|