@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
|
@@ -4,17 +4,20 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
4
4
|
import * as chat from './media/chat.css';
|
|
5
5
|
import * as chatAgentHover from './media/chatAgentHover.css';
|
|
6
6
|
import * as chatViewWelcome from './media/chatViewWelcome.css';
|
|
7
|
-
import { $ as $$1, findParentWithClass, getTopLeftOffset, append, addStandardDisposableListener, EventType,
|
|
7
|
+
import { $ as $$1, clearNode, setVisibility, findParentWithClass, getTopLeftOffset, append, addStandardDisposableListener, EventType, addDisposableListener, scheduleAtNextAnimationFrame, getWindow, createElement, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
8
|
+
import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
8
9
|
import { timeout, disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
9
10
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
10
11
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
11
12
|
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
12
13
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
14
|
+
import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
13
15
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
14
16
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
15
17
|
import { Disposable, MutableDisposable, DisposableStore, thenIfNotDisposed } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
16
18
|
import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
17
19
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
20
|
+
import { IsSessionsWindowContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
18
21
|
import { filter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objects';
|
|
19
22
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
20
23
|
import { isEqual, extUri, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
@@ -23,6 +26,7 @@ import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/ty
|
|
|
23
26
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
24
27
|
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
|
|
25
28
|
import { OffsetRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/offsetRange';
|
|
29
|
+
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
26
30
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
27
31
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
28
32
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -48,7 +52,7 @@ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
|
|
|
48
52
|
import { decidedChatEditingResourceContextKey, ModifiedFileEntryState, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey, inChatEditingSessionContextKey, applyingChatEditsFailedContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
49
53
|
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService.service';
|
|
50
54
|
import { IChatLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/widget/chatLayoutService.service';
|
|
51
|
-
import { ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
55
|
+
import { getModeNameForTelemetry, ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
52
56
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
53
57
|
import { ChatRequestToolPart, ChatRequestToolSetPart, ChatRequestDynamicVariablePart, IParsedChatRequest, chatAgentLeader, chatSubcommandLeader, ChatRequestSlashPromptPart, formatChatQuestion, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
54
58
|
import { ChatRequestParser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatRequestParser';
|
|
@@ -65,19 +69,27 @@ import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/cont
|
|
|
65
69
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
66
70
|
import { ComputeAutomaticInstructions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
|
|
67
71
|
import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
72
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
68
73
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
69
|
-
import { handleModeSwitch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
74
|
+
import { GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID, handleModeSwitch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
70
75
|
import { isIChatResourceViewContext, isIChatViewViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
71
76
|
import { IChatWidgetService, IChatAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
77
|
+
import { IChatAttachmentResolveService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service';
|
|
78
|
+
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables';
|
|
72
79
|
import { ChatSuggestNextWidget } from './chatContentParts/chatSuggestNextWidget.js';
|
|
73
80
|
import { ChatInputPart } from './input/chatInputPart.js';
|
|
74
81
|
import { ChatListWidget } from './chatListWidget.js';
|
|
75
82
|
import { ChatEditorOptions } from './chatOptions.js';
|
|
76
83
|
import { ChatViewWelcomePart } from '../viewsWelcome/chatViewWelcomeController.js';
|
|
84
|
+
import { IChatTipService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatTipService.service';
|
|
85
|
+
import { ChatTipContentPart } from './chatContentParts/chatTipContentPart.js';
|
|
86
|
+
import { ChatContentMarkdownRenderer } from './chatContentMarkdownRenderer.js';
|
|
77
87
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
88
|
+
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
78
89
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
79
90
|
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
80
91
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
92
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
81
93
|
|
|
82
94
|
var ChatWidget_1;
|
|
83
95
|
registerCss(chat);
|
|
@@ -100,9 +112,10 @@ const supportsAllAttachments = {
|
|
|
100
112
|
supportsSourceControlAttachments: true,
|
|
101
113
|
supportsProblemAttachments: true,
|
|
102
114
|
supportsSymbolAttachments: true,
|
|
103
|
-
supportsTerminalAttachments: true
|
|
115
|
+
supportsTerminalAttachments: true,
|
|
116
|
+
supportsPromptAttachments: true
|
|
104
117
|
};
|
|
105
|
-
const DISCLAIMER = ( localize(
|
|
118
|
+
const DISCLAIMER = ( localize(6664, "AI responses may be inaccurate"));
|
|
106
119
|
let ChatWidget = class ChatWidget extends Disposable {
|
|
107
120
|
static {
|
|
108
121
|
ChatWidget_1 = this;
|
|
@@ -151,6 +164,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
151
164
|
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, {
|
|
152
165
|
selectedAgent: this._lastSelectedAgent,
|
|
153
166
|
mode: this.input.currentModeKind,
|
|
167
|
+
attachmentCapabilities: this.attachmentCapabilities,
|
|
154
168
|
forcedAgent: this._lockedAgent?.id ? this.chatAgentService.getAgent(this._lockedAgent.id) : undefined
|
|
155
169
|
});
|
|
156
170
|
this._onDidChangeParsedInput.fire();
|
|
@@ -198,7 +212,10 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
198
212
|
agentSessionsService,
|
|
199
213
|
chatTodoListService,
|
|
200
214
|
contextService,
|
|
201
|
-
lifecycleService
|
|
215
|
+
lifecycleService,
|
|
216
|
+
chatAttachmentResolveService,
|
|
217
|
+
chatTipService,
|
|
218
|
+
chatDebugService
|
|
202
219
|
) {
|
|
203
220
|
super();
|
|
204
221
|
this.viewOptions = viewOptions;
|
|
@@ -227,6 +244,9 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
227
244
|
this.chatTodoListService = chatTodoListService;
|
|
228
245
|
this.contextService = contextService;
|
|
229
246
|
this.lifecycleService = lifecycleService;
|
|
247
|
+
this.chatAttachmentResolveService = chatAttachmentResolveService;
|
|
248
|
+
this.chatTipService = chatTipService;
|
|
249
|
+
this.chatDebugService = chatDebugService;
|
|
230
250
|
this._onDidSubmitAgent = this._register(( new Emitter()));
|
|
231
251
|
this.onDidSubmitAgent = this._onDidSubmitAgent.event;
|
|
232
252
|
this._onDidChangeAgent = this._register(( new Emitter()));
|
|
@@ -245,11 +265,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
245
265
|
this.onDidShow = this._onDidShow.event;
|
|
246
266
|
this._onDidChangeParsedInput = this._register(( new Emitter()));
|
|
247
267
|
this.onDidChangeParsedInput = this._onDidChangeParsedInput.event;
|
|
248
|
-
this.
|
|
268
|
+
this._onDidChangeActiveInputEditor = this._register(( new Emitter()));
|
|
269
|
+
this.onDidChangeActiveInputEditor = this._onDidChangeActiveInputEditor.event;
|
|
270
|
+
this._onWillMaybeChangeHeight = this._register(( new Emitter()));
|
|
249
271
|
this.onWillMaybeChangeHeight = this._onWillMaybeChangeHeight.event;
|
|
250
272
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
251
273
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
252
|
-
this._onDidChangeContentHeight = ( new Emitter());
|
|
274
|
+
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
253
275
|
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
254
276
|
this._onDidChangeEmptyState = this._register(( new Emitter()));
|
|
255
277
|
this.onDidChangeEmptyState = this._onDidChangeEmptyState.event;
|
|
@@ -260,6 +282,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
260
282
|
this.inlineInputPartDisposable = this._register(( new MutableDisposable()));
|
|
261
283
|
this.recentlyRestoredCheckpoint = false;
|
|
262
284
|
this.welcomePart = this._register(( new MutableDisposable()));
|
|
285
|
+
this._gettingStartedTipPart = this._register(( new MutableDisposable()));
|
|
263
286
|
this.visibleChangeCount = 0;
|
|
264
287
|
this._visible = false;
|
|
265
288
|
this._isRenderingWelcome = false;
|
|
@@ -269,12 +292,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
269
292
|
this._isLoadingPromptDescriptions = false;
|
|
270
293
|
this.viewModelDisposables = this._register(( new DisposableStore()));
|
|
271
294
|
this._editingSession = observableValue(this, undefined);
|
|
295
|
+
this._viewModelObs = observableFromEvent(this, this.onDidChangeViewModel, () => this.viewModel);
|
|
272
296
|
this._lockedToCodingAgentContextKey = ChatContextKeys.lockedToCodingAgent.bindTo(this.contextKeyService);
|
|
273
297
|
this._agentSupportsAttachmentsContextKey = ChatContextKeys.agentSupportsAttachments.bindTo(this.contextKeyService);
|
|
274
298
|
this._sessionIsEmptyContextKey = ChatContextKeys.chatSessionIsEmpty.bindTo(this.contextKeyService);
|
|
275
299
|
this._hasPendingRequestsContextKey = ChatContextKeys.hasPendingRequests.bindTo(this.contextKeyService);
|
|
300
|
+
this._sessionHasDebugDataContextKey = ChatContextKeys.chatSessionHasDebugData.bindTo(this.contextKeyService);
|
|
301
|
+
this._register(this.chatDebugService.onDidAddEvent(e => {
|
|
302
|
+
const sessionResource = this.viewModel?.sessionResource;
|
|
303
|
+
if (sessionResource && ( e.sessionResource.toString()) === ( sessionResource.toString())) {
|
|
304
|
+
this._sessionHasDebugDataContextKey.set(true);
|
|
305
|
+
}
|
|
306
|
+
}));
|
|
276
307
|
this.viewContext = viewContext ?? {};
|
|
277
|
-
const viewModelObs =
|
|
308
|
+
const viewModelObs = this._viewModelObs;
|
|
278
309
|
if (typeof location === "object") {
|
|
279
310
|
this._location = location;
|
|
280
311
|
} else {
|
|
@@ -290,6 +321,21 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
290
321
|
this._register(
|
|
291
322
|
this.chatEntitlementService.onDidChangeAnonymous(() => this.renderWelcomeViewContentIfNeeded())
|
|
292
323
|
);
|
|
324
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
325
|
+
if (e.affectsConfiguration("chat.tips.enabled")) {
|
|
326
|
+
if (!this.configurationService.getValue("chat.tips.enabled")) {
|
|
327
|
+
if (this.inputPart) {
|
|
328
|
+
this._gettingStartedTipPartRef = undefined;
|
|
329
|
+
this._gettingStartedTipPart.clear();
|
|
330
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
331
|
+
clearNode(tipContainer);
|
|
332
|
+
setVisibility(false, tipContainer);
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
this.updateChatViewVisibility();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}));
|
|
293
339
|
this._register(
|
|
294
340
|
bindContextKey(decidedChatEditingResourceContextKey, contextKeyService, reader => {
|
|
295
341
|
const currentSession = this._editingSession.read(reader);
|
|
@@ -469,6 +515,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
469
515
|
get contentHeight() {
|
|
470
516
|
return this.input.height.get() + this.listWidget.contentHeight + this.chatSuggestNextWidget.height;
|
|
471
517
|
}
|
|
518
|
+
get scrollTop() {
|
|
519
|
+
return this.listWidget.scrollTop;
|
|
520
|
+
}
|
|
521
|
+
set scrollTop(value) {
|
|
522
|
+
this.listWidget.scrollTop = value;
|
|
523
|
+
}
|
|
472
524
|
get attachmentModel() {
|
|
473
525
|
return this.input.attachmentModel;
|
|
474
526
|
}
|
|
@@ -527,6 +579,9 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
527
579
|
...this.viewOptions.rendererOptions,
|
|
528
580
|
renderStyle
|
|
529
581
|
});
|
|
582
|
+
this._register(addDisposableListener(parent, EventType.MOUSE_WHEEL, e => {
|
|
583
|
+
this.listWidget.delegateScrollFromMouseWheelEvent(e);
|
|
584
|
+
}));
|
|
530
585
|
this._register(autorun(reader => {
|
|
531
586
|
const fontFamily = this.chatLayoutService.fontFamily.read(reader);
|
|
532
587
|
const fontSize = this.chatLayoutService.fontSize.read(reader);
|
|
@@ -579,6 +634,61 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
579
634
|
this.input.focus();
|
|
580
635
|
this._onDidFocus.fire();
|
|
581
636
|
}
|
|
637
|
+
focusTodosView() {
|
|
638
|
+
if (!this.input.hasVisibleTodos()) {
|
|
639
|
+
return false;
|
|
640
|
+
}
|
|
641
|
+
return this.input.focusTodoList();
|
|
642
|
+
}
|
|
643
|
+
toggleTodosViewFocus() {
|
|
644
|
+
if (!this.input.hasVisibleTodos()) {
|
|
645
|
+
return false;
|
|
646
|
+
}
|
|
647
|
+
if (this.input.isTodoListFocused()) {
|
|
648
|
+
this.focusInput();
|
|
649
|
+
return true;
|
|
650
|
+
}
|
|
651
|
+
return this.input.focusTodoList();
|
|
652
|
+
}
|
|
653
|
+
focusQuestionCarousel() {
|
|
654
|
+
if (!this.input.questionCarousel) {
|
|
655
|
+
return false;
|
|
656
|
+
}
|
|
657
|
+
return this.input.focusQuestionCarousel();
|
|
658
|
+
}
|
|
659
|
+
toggleQuestionCarouselFocus() {
|
|
660
|
+
if (!this.input.questionCarousel) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
if (this.input.isQuestionCarouselFocused()) {
|
|
664
|
+
this.focusInput();
|
|
665
|
+
return true;
|
|
666
|
+
}
|
|
667
|
+
return this.input.focusQuestionCarousel();
|
|
668
|
+
}
|
|
669
|
+
navigateToPreviousQuestion() {
|
|
670
|
+
if (!this.input.questionCarousel) {
|
|
671
|
+
return false;
|
|
672
|
+
}
|
|
673
|
+
return this.input.navigateToPreviousQuestion();
|
|
674
|
+
}
|
|
675
|
+
navigateToNextQuestion() {
|
|
676
|
+
if (!this.input.questionCarousel) {
|
|
677
|
+
return false;
|
|
678
|
+
}
|
|
679
|
+
return this.input.navigateToNextQuestion();
|
|
680
|
+
}
|
|
681
|
+
toggleTipFocus() {
|
|
682
|
+
if (this._gettingStartedTipPartRef?.hasFocus()) {
|
|
683
|
+
this.focusInput();
|
|
684
|
+
return true;
|
|
685
|
+
}
|
|
686
|
+
if (!this._gettingStartedTipPartRef) {
|
|
687
|
+
return false;
|
|
688
|
+
}
|
|
689
|
+
this._gettingStartedTipPartRef.focus();
|
|
690
|
+
return true;
|
|
691
|
+
}
|
|
582
692
|
hasInputFocus() {
|
|
583
693
|
return this.input.hasFocus();
|
|
584
694
|
}
|
|
@@ -589,7 +699,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
589
699
|
const previous = this.parsedChatRequest;
|
|
590
700
|
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequest(this.viewModel.sessionResource, this.getInput(), this.location, {
|
|
591
701
|
selectedAgent: this._lastSelectedAgent,
|
|
592
|
-
mode: this.input.currentModeKind
|
|
702
|
+
mode: this.input.currentModeKind,
|
|
703
|
+
attachmentCapabilities: this.attachmentCapabilities
|
|
593
704
|
});
|
|
594
705
|
if (!previous || !IParsedChatRequest.equals(previous, this.parsedChatRequest)) {
|
|
595
706
|
this._onDidChangeParsedInput.fire();
|
|
@@ -657,10 +768,26 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
657
768
|
}
|
|
658
769
|
updateChatViewVisibility() {
|
|
659
770
|
if (this.viewModel) {
|
|
771
|
+
const isStandardLayout = this.viewOptions.renderStyle !== "compact" && this.viewOptions.renderStyle !== "minimal";
|
|
660
772
|
const numItems = this.viewModel.getItems().length;
|
|
661
773
|
setVisibility(numItems === 0, this.welcomeMessageContainer);
|
|
662
774
|
setVisibility(numItems !== 0, this.listContainer);
|
|
775
|
+
if (isStandardLayout && this.inputPart) {
|
|
776
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
777
|
+
if (numItems === 0) {
|
|
778
|
+
this.renderGettingStartedTipIfNeeded();
|
|
779
|
+
} else {
|
|
780
|
+
this._gettingStartedTipPartRef = undefined;
|
|
781
|
+
this._gettingStartedTipPart.clear();
|
|
782
|
+
clearNode(tipContainer);
|
|
783
|
+
setVisibility(false, tipContainer);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
663
786
|
}
|
|
787
|
+
this.container.classList.toggle(
|
|
788
|
+
"chat-view-getting-started-disabled",
|
|
789
|
+
this.chatEntitlementService.sentiment.installed
|
|
790
|
+
);
|
|
664
791
|
this._onDidChangeEmptyState.fire();
|
|
665
792
|
}
|
|
666
793
|
isEmpty() {
|
|
@@ -682,7 +809,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
682
809
|
if (this.chatEntitlementService.anonymous && !this.chatEntitlementService.sentiment.installed) {
|
|
683
810
|
const providers = product.defaultChatAgent.provider;
|
|
684
811
|
additionalMessage = ( new MarkdownString(( localize(
|
|
685
|
-
|
|
812
|
+
6665,
|
|
686
813
|
"By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3}).",
|
|
687
814
|
providers.default.name,
|
|
688
815
|
providers.default.name,
|
|
@@ -712,6 +839,37 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
712
839
|
this._isRenderingWelcome = false;
|
|
713
840
|
}
|
|
714
841
|
}
|
|
842
|
+
renderGettingStartedTipIfNeeded() {
|
|
843
|
+
if (!this.inputPart) {
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
847
|
+
if (this._gettingStartedTipPart.value) {
|
|
848
|
+
setVisibility(true, tipContainer);
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
851
|
+
const tip = this.chatTipService.getWelcomeTip(this.contextKeyService);
|
|
852
|
+
if (!tip) {
|
|
853
|
+
setVisibility(false, tipContainer);
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
const store = ( new DisposableStore());
|
|
857
|
+
const renderer = this.instantiationService.createInstance(ChatContentMarkdownRenderer);
|
|
858
|
+
const tipPart = store.add(
|
|
859
|
+
this.instantiationService.createInstance(ChatTipContentPart, tip, renderer)
|
|
860
|
+
);
|
|
861
|
+
tipContainer.appendChild(tipPart.domNode);
|
|
862
|
+
this._gettingStartedTipPartRef = tipPart;
|
|
863
|
+
store.add(tipPart.onDidHide(() => {
|
|
864
|
+
tipPart.domNode.remove();
|
|
865
|
+
this._gettingStartedTipPartRef = undefined;
|
|
866
|
+
this._gettingStartedTipPart.clear();
|
|
867
|
+
setVisibility(false, tipContainer);
|
|
868
|
+
this.focusInput();
|
|
869
|
+
}));
|
|
870
|
+
this._gettingStartedTipPart.value = store;
|
|
871
|
+
setVisibility(true, tipContainer);
|
|
872
|
+
}
|
|
715
873
|
_getGenerateInstructionsMessage() {
|
|
716
874
|
if (!this._instructionFilesCheckPromise) {
|
|
717
875
|
this._instructionFilesCheckPromise = this._checkForAgentInstructionFiles();
|
|
@@ -726,14 +884,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
726
884
|
if (this._instructionFilesExist === true) {
|
|
727
885
|
return ( new MarkdownString(""));
|
|
728
886
|
} else if (this._instructionFilesExist === false) {
|
|
729
|
-
const generateInstructionsCommand = "workbench.action.chat.generateInstructions";
|
|
730
887
|
return (new MarkdownString(localize(
|
|
731
|
-
|
|
888
|
+
6666,
|
|
732
889
|
"[Generate Agent Instructions]({0}) to onboard AI onto your codebase.",
|
|
733
|
-
`command:${
|
|
890
|
+
`command:${GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID}`
|
|
734
891
|
), {
|
|
735
892
|
isTrusted: {
|
|
736
|
-
enabledCommands: [
|
|
893
|
+
enabledCommands: [GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID]
|
|
737
894
|
}
|
|
738
895
|
}));
|
|
739
896
|
}
|
|
@@ -753,19 +910,19 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
753
910
|
const providerTitle = this._lockedAgent ? this.chatSessionsService.getWelcomeTitleForSessionType(this._lockedAgent.id) : undefined;
|
|
754
911
|
const providerMessage = this._lockedAgent ? this.chatSessionsService.getWelcomeMessageForSessionType(this._lockedAgent.id) : undefined;
|
|
755
912
|
const message = providerMessage ? ( new MarkdownString(providerMessage)) : (this._lockedAgent?.prefix === "@copilot " ? ( new MarkdownString(( localize(
|
|
756
|
-
|
|
913
|
+
6667,
|
|
757
914
|
"This chat session will be forwarded to the {0} [coding agent]({1}) where work is completed in the background. ",
|
|
758
915
|
this._lockedAgent.prefix,
|
|
759
916
|
"https://aka.ms/coding-agent-docs"
|
|
760
917
|
)) + DISCLAIMER, {
|
|
761
918
|
isTrusted: true
|
|
762
919
|
})) : ( new MarkdownString(( localize(
|
|
763
|
-
|
|
920
|
+
6668,
|
|
764
921
|
"This chat session will be forwarded to the {0} coding agent where work is completed in the background. ",
|
|
765
922
|
this._lockedAgent?.prefix
|
|
766
923
|
)) + DISCLAIMER)));
|
|
767
924
|
return {
|
|
768
|
-
title: providerTitle ?? ( localize(
|
|
925
|
+
title: providerTitle ?? ( localize(6669, "Delegate to {0}", this._lockedAgent?.prefix)),
|
|
769
926
|
message,
|
|
770
927
|
icon: providerIcon ?? Codicon.sendToRemoteAgent,
|
|
771
928
|
additionalMessage,
|
|
@@ -774,11 +931,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
774
931
|
}
|
|
775
932
|
let title;
|
|
776
933
|
if (this.input.currentModeKind === ChatModeKind.Ask) {
|
|
777
|
-
title = ( localize(
|
|
934
|
+
title = ( localize(6670, "Ask about your code"));
|
|
778
935
|
} else if (this.input.currentModeKind === ChatModeKind.Edit) {
|
|
779
|
-
title = ( localize(
|
|
936
|
+
title = ( localize(6671, "Edit in context"));
|
|
780
937
|
} else {
|
|
781
|
-
title = ( localize(
|
|
938
|
+
title = ( localize(6672, "Build with Agent"));
|
|
782
939
|
}
|
|
783
940
|
return {
|
|
784
941
|
title,
|
|
@@ -794,22 +951,22 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
794
951
|
if (isEmpty) {
|
|
795
952
|
return [{
|
|
796
953
|
icon: Codicon.vscode,
|
|
797
|
-
label: ( localize(
|
|
798
|
-
prompt: ( localize(
|
|
954
|
+
label: ( localize(6673, "Ask @vscode")),
|
|
955
|
+
prompt: ( localize(6674, "@vscode How do I change the theme to light mode?"))
|
|
799
956
|
}, {
|
|
800
957
|
icon: Codicon.newFolder,
|
|
801
|
-
label: ( localize(
|
|
802
|
-
prompt: ( localize(
|
|
958
|
+
label: ( localize(6675, "Create Project")),
|
|
959
|
+
prompt: ( localize(6676, "Create a #new Hello World project in TypeScript"))
|
|
803
960
|
}];
|
|
804
961
|
} else {
|
|
805
962
|
return [{
|
|
806
963
|
icon: Codicon.debugAlt,
|
|
807
|
-
label: ( localize(
|
|
808
|
-
prompt: ( localize(
|
|
964
|
+
label: ( localize(6677, "Build Workspace")),
|
|
965
|
+
prompt: ( localize(6678, "How do I build this workspace?"))
|
|
809
966
|
}, {
|
|
810
967
|
icon: Codicon.gear,
|
|
811
|
-
label: ( localize(
|
|
812
|
-
prompt: ( localize(
|
|
968
|
+
label: ( localize(6679, "Show Config")),
|
|
969
|
+
prompt: ( localize(6680, "Where is the configuration for this project defined?"))
|
|
813
970
|
}];
|
|
814
971
|
}
|
|
815
972
|
}
|
|
@@ -881,7 +1038,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
881
1038
|
promptName
|
|
882
1039
|
} of topPrompts) {
|
|
883
1040
|
const description = this.promptDescriptionsCache.get(promptName);
|
|
884
|
-
const commandLabel = ( localize(
|
|
1041
|
+
const commandLabel = ( localize(6681, "{0}", promptName));
|
|
885
1042
|
const uri = this.promptUriCache.get(promptName);
|
|
886
1043
|
const descriptionText = description?.trim() ? description : undefined;
|
|
887
1044
|
result.push({
|
|
@@ -962,7 +1119,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
962
1119
|
this.chatSuggestNextWidget.render(currentMode);
|
|
963
1120
|
if (wasHidden) {
|
|
964
1121
|
this.telemetryService.publicLog2("chat.handoffWidgetShown", {
|
|
965
|
-
agent: currentMode
|
|
1122
|
+
agent: getModeNameForTelemetry(currentMode),
|
|
966
1123
|
handoffCount: handoffs.length
|
|
967
1124
|
});
|
|
968
1125
|
}
|
|
@@ -977,10 +1134,10 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
977
1134
|
this.chatSuggestNextWidget.hide();
|
|
978
1135
|
const promptToUse = handoff.prompt;
|
|
979
1136
|
const currentMode = this.input.currentModeObs.get();
|
|
980
|
-
const
|
|
1137
|
+
const toMode = handoff.agent ? this.chatModeService.findModeByName(handoff.agent) : undefined;
|
|
981
1138
|
this.telemetryService.publicLog2("chat.handoffClicked", {
|
|
982
|
-
fromAgent:
|
|
983
|
-
toAgent: agentId ||
|
|
1139
|
+
fromAgent: getModeNameForTelemetry(currentMode),
|
|
1140
|
+
toAgent: agentId || (toMode ? getModeNameForTelemetry(toMode) : ""),
|
|
984
1141
|
hasPrompt: Boolean(promptToUse),
|
|
985
1142
|
autoSend: Boolean(handoff.send)
|
|
986
1143
|
});
|
|
@@ -1004,40 +1161,64 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1004
1161
|
if (!this._shouldExitAfterDelegation(sourceAgent, targetAgent)) {
|
|
1005
1162
|
return;
|
|
1006
1163
|
}
|
|
1164
|
+
this.logService.debug(
|
|
1165
|
+
`[Delegation] Will exit after delegation: sourceAgent=${sourceAgent?.id}, targetAgent=${targetAgent?.id}`
|
|
1166
|
+
);
|
|
1007
1167
|
try {
|
|
1008
1168
|
await this._handleDelegationExit();
|
|
1009
1169
|
} catch (e) {
|
|
1010
|
-
this.logService.error("Failed to handle delegation exit", e);
|
|
1170
|
+
this.logService.error("[Delegation] Failed to handle delegation exit", e);
|
|
1011
1171
|
}
|
|
1012
1172
|
}
|
|
1013
1173
|
_shouldExitAfterDelegation(sourceAgent, targetAgent) {
|
|
1014
1174
|
if (!targetAgent) {
|
|
1175
|
+
this.logService.debug("[Delegation] _shouldExitAfterDelegation: false (no targetAgent)");
|
|
1015
1176
|
return false;
|
|
1016
1177
|
}
|
|
1017
1178
|
if (!this.configurationService.getValue(ChatConfiguration.ExitAfterDelegation)) {
|
|
1179
|
+
this.logService.debug(
|
|
1180
|
+
"[Delegation] _shouldExitAfterDelegation: false (ExitAfterDelegation config disabled)"
|
|
1181
|
+
);
|
|
1018
1182
|
return false;
|
|
1019
1183
|
}
|
|
1020
1184
|
if (sourceAgent && sourceAgent.id === targetAgent.id) {
|
|
1185
|
+
this.logService.debug(
|
|
1186
|
+
"[Delegation] _shouldExitAfterDelegation: false (source and target agents are the same)"
|
|
1187
|
+
);
|
|
1021
1188
|
return false;
|
|
1022
1189
|
}
|
|
1023
1190
|
if (!isIChatViewViewContext(this.viewContext)) {
|
|
1191
|
+
this.logService.debug(
|
|
1192
|
+
"[Delegation] _shouldExitAfterDelegation: false (not in chat view context)"
|
|
1193
|
+
);
|
|
1024
1194
|
return false;
|
|
1025
1195
|
}
|
|
1026
1196
|
const contribution = this.chatSessionsService.getChatSessionContribution(targetAgent.id);
|
|
1027
1197
|
if (!contribution) {
|
|
1198
|
+
this.logService.debug(
|
|
1199
|
+
`[Delegation] _shouldExitAfterDelegation: false (no contribution found for targetAgent.id=${targetAgent.id})`
|
|
1200
|
+
);
|
|
1028
1201
|
return false;
|
|
1029
1202
|
}
|
|
1030
1203
|
if (contribution.canDelegate !== true) {
|
|
1204
|
+
this.logService.debug(
|
|
1205
|
+
`[Delegation] _shouldExitAfterDelegation: false (contribution.canDelegate=${contribution.canDelegate}, expected true)`
|
|
1206
|
+
);
|
|
1031
1207
|
return false;
|
|
1032
1208
|
}
|
|
1209
|
+
this.logService.debug("[Delegation] _shouldExitAfterDelegation: true");
|
|
1033
1210
|
return true;
|
|
1034
1211
|
}
|
|
1035
1212
|
async _handleDelegationExit() {
|
|
1036
1213
|
const viewModel = this.viewModel;
|
|
1037
1214
|
if (!viewModel) {
|
|
1215
|
+
this.logService.debug("[Delegation] _handleDelegationExit: no viewModel, returning");
|
|
1038
1216
|
return;
|
|
1039
1217
|
}
|
|
1040
1218
|
const parentSessionResource = viewModel.sessionResource;
|
|
1219
|
+
this.logService.debug(
|
|
1220
|
+
`[Delegation] _handleDelegationExit: parentSessionResource=${( parentSessionResource.toString())}`
|
|
1221
|
+
);
|
|
1041
1222
|
const checkIfShouldClear = () => {
|
|
1042
1223
|
const items = viewModel.getItems();
|
|
1043
1224
|
const lastItem = items[items.length - 1];
|
|
@@ -1048,10 +1229,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1048
1229
|
return false;
|
|
1049
1230
|
};
|
|
1050
1231
|
if (checkIfShouldClear()) {
|
|
1232
|
+
this.logService.debug("[Delegation] Response complete, archiving session before clearing");
|
|
1233
|
+
await this.archiveLocalParentSession(parentSessionResource);
|
|
1051
1234
|
await this.clear();
|
|
1052
|
-
this.archiveLocalParentSession(parentSessionResource);
|
|
1053
1235
|
return;
|
|
1054
1236
|
}
|
|
1237
|
+
this.logService.debug("[Delegation] Waiting for response to complete...");
|
|
1055
1238
|
const shouldClear = await ( new Promise(resolve => {
|
|
1056
1239
|
const disposable = viewModel.onDidChange(() => {
|
|
1057
1240
|
const result = checkIfShouldClear();
|
|
@@ -1061,6 +1244,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1061
1244
|
}
|
|
1062
1245
|
});
|
|
1063
1246
|
const timeout = setTimeout(() => {
|
|
1247
|
+
this.logService.debug("[Delegation] Timeout waiting for response to complete");
|
|
1064
1248
|
cleanup();
|
|
1065
1249
|
resolve(false);
|
|
1066
1250
|
}, 30_000);
|
|
@@ -1070,17 +1254,30 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1070
1254
|
};
|
|
1071
1255
|
}));
|
|
1072
1256
|
if (shouldClear) {
|
|
1257
|
+
this.logService.debug("[Delegation] Response completed, archiving session before clearing");
|
|
1258
|
+
await this.archiveLocalParentSession(parentSessionResource);
|
|
1073
1259
|
await this.clear();
|
|
1074
|
-
|
|
1260
|
+
} else {
|
|
1261
|
+
this.logService.debug("[Delegation] Not clearing (timeout or error)");
|
|
1075
1262
|
}
|
|
1076
1263
|
}
|
|
1077
1264
|
async archiveLocalParentSession(sessionResource) {
|
|
1078
|
-
if (sessionResource.scheme !== Schemas.vscodeLocalChatSession) {
|
|
1265
|
+
if (sessionResource.scheme !== Schemas.vscodeLocalChatSession && !IsSessionsWindowContext.getValue(this.contextKeyService)) {
|
|
1079
1266
|
return;
|
|
1080
1267
|
}
|
|
1268
|
+
this.logService.debug(
|
|
1269
|
+
`[Delegation] archiveLocalParentSession: archiving session ${( sessionResource.toString())}`
|
|
1270
|
+
);
|
|
1081
1271
|
await this.chatService.getSession(sessionResource)?.editingSession?.accept();
|
|
1082
1272
|
const session = this.agentSessionsService.getSession(sessionResource);
|
|
1083
|
-
session
|
|
1273
|
+
if (session) {
|
|
1274
|
+
session.setArchived(true);
|
|
1275
|
+
this.logService.debug("[Delegation] archiveLocalParentSession: session archived successfully");
|
|
1276
|
+
} else {
|
|
1277
|
+
this.logService.warn(
|
|
1278
|
+
`[Delegation] archiveLocalParentSession: session not found in agentSessionsService for ${( sessionResource.toString())}`
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1084
1281
|
}
|
|
1085
1282
|
setVisible(visible) {
|
|
1086
1283
|
const wasVisible = this._visible;
|
|
@@ -1178,13 +1375,14 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1178
1375
|
const currentContext = [];
|
|
1179
1376
|
const addedContextIds = ( new Set());
|
|
1180
1377
|
const addToContext = entry => {
|
|
1181
|
-
|
|
1378
|
+
const dedupKey = entry.range ? `${entry.id}:${entry.range.start}-${entry.range.endExclusive}` : entry.id;
|
|
1379
|
+
if (( addedContextIds.has(dedupKey)) || isWorkspaceVariableEntry(entry)) {
|
|
1182
1380
|
return;
|
|
1183
1381
|
}
|
|
1184
1382
|
if ((isPromptFileVariableEntry(entry) || isPromptTextVariableEntry(entry)) && entry.automaticallyAdded) {
|
|
1185
1383
|
return;
|
|
1186
1384
|
}
|
|
1187
|
-
addedContextIds.add(
|
|
1385
|
+
addedContextIds.add(dedupKey);
|
|
1188
1386
|
currentContext.push(entry);
|
|
1189
1387
|
};
|
|
1190
1388
|
for (let i = requests.length - 1; i >= 0; i -= 1) {
|
|
@@ -1209,6 +1407,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1209
1407
|
this.createInput(this.inputContainer);
|
|
1210
1408
|
this.input.setChatMode(this.inputPart.currentModeObs.get().id);
|
|
1211
1409
|
this.input.setEditing(true, isEditingSentRequest);
|
|
1410
|
+
this._onDidChangeActiveInputEditor.fire();
|
|
1212
1411
|
} else {
|
|
1213
1412
|
this.inputPart.element.classList.add("editing");
|
|
1214
1413
|
}
|
|
@@ -1219,6 +1418,34 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1219
1418
|
this.inputPart.dnd.setDisabledOverlay(!isInput);
|
|
1220
1419
|
this.input.renderAttachedContext();
|
|
1221
1420
|
this.input.setValue(currentElement.messageText, false);
|
|
1421
|
+
const dynamicVariableModel = this.getContrib(ChatDynamicVariableModel.ID);
|
|
1422
|
+
const editorModel = this.input.inputEditor.getModel();
|
|
1423
|
+
if (dynamicVariableModel && editorModel) {
|
|
1424
|
+
const modelTextLength = editorModel.getValueLength();
|
|
1425
|
+
for (const entry of currentContext) {
|
|
1426
|
+
if (entry.range) {
|
|
1427
|
+
if (entry.range.start >= entry.range.endExclusive) {
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
if (entry.range.start < 0 || entry.range.endExclusive > modelTextLength) {
|
|
1431
|
+
continue;
|
|
1432
|
+
}
|
|
1433
|
+
const startPos = editorModel.getPositionAt(entry.range.start);
|
|
1434
|
+
const endPos = editorModel.getPositionAt(entry.range.endExclusive);
|
|
1435
|
+
dynamicVariableModel.addReference({
|
|
1436
|
+
id: entry.id,
|
|
1437
|
+
range: ( new Range(startPos.lineNumber, startPos.column, endPos.lineNumber, endPos.column)),
|
|
1438
|
+
data: entry.value,
|
|
1439
|
+
fullName: entry.fullName,
|
|
1440
|
+
icon: entry.icon,
|
|
1441
|
+
modelDescription: entry.modelDescription,
|
|
1442
|
+
isFile: entry.kind === "file",
|
|
1443
|
+
isDirectory: entry.kind === "directory"
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
this.listWidget.suppressAutoScroll = true;
|
|
1222
1449
|
this.onDidChangeItems();
|
|
1223
1450
|
this.input.inputEditor.focus();
|
|
1224
1451
|
this._register(this.inputPart.onDidClickOverlay(() => {
|
|
@@ -1240,6 +1467,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1240
1467
|
});
|
|
1241
1468
|
}
|
|
1242
1469
|
finishedEditing(completedEdit) {
|
|
1470
|
+
this.listWidget.suppressAutoScroll = false;
|
|
1243
1471
|
const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
|
|
1244
1472
|
if (this.recentlyRestoredCheckpoint) {
|
|
1245
1473
|
this.recentlyRestoredCheckpoint = false;
|
|
@@ -1275,6 +1503,9 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1275
1503
|
}
|
|
1276
1504
|
this.viewModel?.setEditing(undefined);
|
|
1277
1505
|
this.inputPart?.setEditing(false, undefined);
|
|
1506
|
+
if (!isInput) {
|
|
1507
|
+
this._onDidChangeActiveInputEditor.fire();
|
|
1508
|
+
}
|
|
1278
1509
|
this.onDidChangeItems();
|
|
1279
1510
|
this.telemetryService.publicLog2("chat.editRequestsFinished", {
|
|
1280
1511
|
editRequestType: this.configurationService.getValue("chat.editRequests"),
|
|
@@ -1309,8 +1540,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1309
1540
|
widgetViewKindTag: this.getWidgetViewKindTag(),
|
|
1310
1541
|
defaultMode: this.viewOptions.defaultMode,
|
|
1311
1542
|
sessionTypePickerDelegate: this.viewOptions.sessionTypePickerDelegate,
|
|
1312
|
-
workspacePickerDelegate: this.viewOptions.workspacePickerDelegate
|
|
1313
|
-
isQuickChat: isQuickChat(this)
|
|
1543
|
+
workspacePickerDelegate: this.viewOptions.workspacePickerDelegate
|
|
1314
1544
|
};
|
|
1315
1545
|
if (this.viewModel?.editing) {
|
|
1316
1546
|
const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
|
|
@@ -1386,6 +1616,22 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1386
1616
|
this.renderFollowups();
|
|
1387
1617
|
this.renderChatSuggestNextWidget();
|
|
1388
1618
|
}));
|
|
1619
|
+
let previousModelIdentifier;
|
|
1620
|
+
this._register(autorun(reader => {
|
|
1621
|
+
const modelIdentifier = this.inputPart.selectedLanguageModel.read(reader)?.identifier;
|
|
1622
|
+
if (previousModelIdentifier === undefined) {
|
|
1623
|
+
previousModelIdentifier = modelIdentifier;
|
|
1624
|
+
return;
|
|
1625
|
+
}
|
|
1626
|
+
if (previousModelIdentifier === modelIdentifier) {
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
previousModelIdentifier = modelIdentifier;
|
|
1630
|
+
if (!this._gettingStartedTipPartRef) {
|
|
1631
|
+
return;
|
|
1632
|
+
}
|
|
1633
|
+
this.chatTipService.getWelcomeTip(this.contextKeyService);
|
|
1634
|
+
}));
|
|
1389
1635
|
this._register(autorun(r => {
|
|
1390
1636
|
const toolSetIds = ( new Set());
|
|
1391
1637
|
const toolIds = ( new Set());
|
|
@@ -1438,15 +1684,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1438
1684
|
}
|
|
1439
1685
|
this.inputPart.clearTodoListWidget(model.sessionResource, false);
|
|
1440
1686
|
this.chatSuggestNextWidget.hide();
|
|
1687
|
+
this.chatTipService.resetSession();
|
|
1688
|
+
this._gettingStartedTipPartRef = undefined;
|
|
1689
|
+
this._gettingStartedTipPart.clear();
|
|
1690
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
1691
|
+
clearNode(tipContainer);
|
|
1692
|
+
setVisibility(false, tipContainer);
|
|
1441
1693
|
this._codeBlockModelCollection.clear();
|
|
1442
|
-
this.container.setAttribute("data-session-id", model.sessionId);
|
|
1443
1694
|
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1444
1695
|
this.inputPart.setInputModel(model.inputModel, model.getRequests().length === 0);
|
|
1445
1696
|
this.listWidget.setViewModel(this.viewModel);
|
|
1446
1697
|
if (this._lockedAgent) {
|
|
1447
1698
|
let placeholder = this.chatSessionsService.getInputPlaceholderForSessionType(this._lockedAgent.id);
|
|
1448
1699
|
if (!placeholder) {
|
|
1449
|
-
placeholder = ( localize(
|
|
1700
|
+
placeholder = ( localize(6682, "Chat with {0}", this._lockedAgent.id));
|
|
1450
1701
|
}
|
|
1451
1702
|
this.viewModel.setInputPlaceholder(placeholder);
|
|
1452
1703
|
this.inputEditor.updateOptions({
|
|
@@ -1484,12 +1735,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1484
1735
|
this.onDidChangeItems();
|
|
1485
1736
|
}));
|
|
1486
1737
|
this._sessionIsEmptyContextKey.set(model.getRequests().length === 0);
|
|
1487
|
-
|
|
1488
|
-
|
|
1738
|
+
this._sessionHasDebugDataContextKey.set(this.chatDebugService.getEvents(model.sessionResource).length > 0);
|
|
1739
|
+
let lastSteeringCount = 0;
|
|
1740
|
+
const updatePendingRequestKeys = announceSteering => {
|
|
1741
|
+
const pendingRequests = model.getPendingRequests();
|
|
1742
|
+
const pendingCount = pendingRequests.length;
|
|
1489
1743
|
this._hasPendingRequestsContextKey.set(pendingCount > 0);
|
|
1744
|
+
const steeringCount = pendingRequests.filter(pending => pending.kind === ChatRequestQueueKind.Steering).length;
|
|
1745
|
+
if (announceSteering && steeringCount > 0 && lastSteeringCount === 0) {
|
|
1746
|
+
status(( localize(6683, "Steering")));
|
|
1747
|
+
}
|
|
1748
|
+
lastSteeringCount = steeringCount;
|
|
1490
1749
|
};
|
|
1491
|
-
updatePendingRequestKeys();
|
|
1492
|
-
this.viewModelDisposables.add(model.onDidChangePendingRequests(() => updatePendingRequestKeys()));
|
|
1750
|
+
updatePendingRequestKeys(false);
|
|
1751
|
+
this.viewModelDisposables.add(model.onDidChangePendingRequests(() => updatePendingRequestKeys(true)));
|
|
1493
1752
|
this.refreshParsedInput();
|
|
1494
1753
|
this.viewModelDisposables.add(model.onDidChange(e => {
|
|
1495
1754
|
if (e.kind === "setAgent") {
|
|
@@ -1655,6 +1914,17 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1655
1914
|
toolReferences
|
|
1656
1915
|
));
|
|
1657
1916
|
requestInput.input = ( this.parsedInput.parts.filter(part => !(part instanceof ChatRequestSlashPromptPart)).map(part => part.text)).join("").trim();
|
|
1917
|
+
const promptPath = slashCommand.promptPath;
|
|
1918
|
+
const promptRunEvent = {
|
|
1919
|
+
storage: promptPath.storage
|
|
1920
|
+
};
|
|
1921
|
+
if (promptPath.storage === PromptsStorage.extension) {
|
|
1922
|
+
promptRunEvent.extensionId = promptPath.extension.identifier.value;
|
|
1923
|
+
promptRunEvent.promptName = slashCommand.name;
|
|
1924
|
+
} else {
|
|
1925
|
+
promptRunEvent.promptNameHash = ( hash(slashCommand.name).toString(16));
|
|
1926
|
+
}
|
|
1927
|
+
this.telemetryService.publicLog2("chat.promptRun", promptRunEvent);
|
|
1658
1928
|
const input = requestInput.input.trim();
|
|
1659
1929
|
requestInput.input = `Follow instructions in [${basename(parseResult.uri)}](${( parseResult.uri.toString())}).`;
|
|
1660
1930
|
if (input) {
|
|
@@ -1704,7 +1974,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1704
1974
|
this.chatService.removePendingRequest(this.viewModel.sessionResource, editingRequestId);
|
|
1705
1975
|
options.queue ??= editingPendingRequest;
|
|
1706
1976
|
} else {
|
|
1707
|
-
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource);
|
|
1977
|
+
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-editing");
|
|
1708
1978
|
options.queue = undefined;
|
|
1709
1979
|
}
|
|
1710
1980
|
this.finishedEditing(true);
|
|
@@ -1712,10 +1982,17 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1712
1982
|
}
|
|
1713
1983
|
const model = this.viewModel.model;
|
|
1714
1984
|
const requestInProgress = model.requestInProgress.get();
|
|
1985
|
+
if (options.alwaysQueue) {
|
|
1986
|
+
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1987
|
+
}
|
|
1988
|
+
if (model.requestNeedsInput.get() && !model.getPendingRequests().length) {
|
|
1989
|
+
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-needsInput");
|
|
1990
|
+
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1991
|
+
}
|
|
1715
1992
|
if (requestInProgress) {
|
|
1716
1993
|
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1717
1994
|
}
|
|
1718
|
-
if (!requestInProgress && !isEditing && !(await this.confirmPendingRequestsBeforeSend(model, options))) {
|
|
1995
|
+
if (!options.alwaysQueue && !requestInProgress && !isEditing && !(await this.confirmPendingRequestsBeforeSend(model, options))) {
|
|
1719
1996
|
return;
|
|
1720
1997
|
}
|
|
1721
1998
|
await this._applyPromptFileIfSet(requestInputs);
|
|
@@ -1751,27 +2028,26 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1751
2028
|
}
|
|
1752
2029
|
}
|
|
1753
2030
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
}
|
|
2031
|
+
const resolvedImageVariables = await this._resolveDirectoryImageAttachments(requestInputs.attachedContext.asArray());
|
|
2032
|
+
const submittedSessionResource = this.viewModel.sessionResource;
|
|
1757
2033
|
const result = await this.chatService.sendRequest(this.viewModel.sessionResource, requestInputs.input, {
|
|
1758
2034
|
userSelectedModelId: this.input.currentLanguageModel,
|
|
1759
2035
|
location: this.location,
|
|
1760
2036
|
locationData: this._location.resolveData?.(),
|
|
1761
2037
|
parserContext: {
|
|
1762
2038
|
selectedAgent: this._lastSelectedAgent,
|
|
1763
|
-
mode: this.input.currentModeKind
|
|
2039
|
+
mode: this.input.currentModeKind,
|
|
2040
|
+
attachmentCapabilities: this._lastSelectedAgent?.capabilities ?? this.attachmentCapabilities
|
|
1764
2041
|
},
|
|
1765
2042
|
attachedContext: requestInputs.attachedContext.asArray(),
|
|
2043
|
+
resolvedVariables: resolvedImageVariables,
|
|
1766
2044
|
noCommandDetection: options?.noCommandDetection,
|
|
1767
2045
|
...this.getModeRequestOptions(),
|
|
1768
2046
|
modeInfo: this.input.currentModeInfo,
|
|
1769
2047
|
agentIdSilent: this._lockedAgent?.id,
|
|
1770
|
-
queue: options?.queue
|
|
2048
|
+
queue: options?.queue,
|
|
2049
|
+
pauseQueue: options?.alwaysQueue
|
|
1771
2050
|
});
|
|
1772
|
-
if (this.viewModel.sessionResource && !options.queue) {
|
|
1773
|
-
this.chatAccessibilityService.disposeRequest(this.viewModel.sessionResource);
|
|
1774
|
-
}
|
|
1775
2051
|
if (ChatSendResult.isRejected(result)) {
|
|
1776
2052
|
return;
|
|
1777
2053
|
}
|
|
@@ -1786,30 +2062,46 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1786
2062
|
slashCommand: sent.data.slashCommand
|
|
1787
2063
|
});
|
|
1788
2064
|
this.handleDelegationExitIfNeeded(this._lockedAgent, sent.data.agent);
|
|
1789
|
-
sent.data.
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
this.
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
this.
|
|
2065
|
+
sent.data.responseCreatedPromise.then(() => {
|
|
2066
|
+
this.chatAccessibilityService.acceptRequest(submittedSessionResource);
|
|
2067
|
+
sent.data.responseCompletePromise.then(() => {
|
|
2068
|
+
const responses = this.viewModel?.getItems().filter(isResponseVM);
|
|
2069
|
+
const lastResponse = responses?.[responses.length - 1];
|
|
2070
|
+
this.chatAccessibilityService.acceptResponse(
|
|
2071
|
+
this,
|
|
2072
|
+
this.container,
|
|
2073
|
+
lastResponse,
|
|
2074
|
+
submittedSessionResource,
|
|
2075
|
+
options?.isVoiceInput
|
|
2076
|
+
);
|
|
2077
|
+
if (lastResponse?.result?.nextQuestion) {
|
|
2078
|
+
const {
|
|
2079
|
+
prompt,
|
|
2080
|
+
participant,
|
|
2081
|
+
command
|
|
2082
|
+
} = lastResponse.result.nextQuestion;
|
|
2083
|
+
const question = formatChatQuestion(this.chatAgentService, this.location, prompt, participant, command);
|
|
2084
|
+
if (question) {
|
|
2085
|
+
this.input.setValue(question, false);
|
|
2086
|
+
}
|
|
1808
2087
|
}
|
|
1809
|
-
}
|
|
2088
|
+
});
|
|
1810
2089
|
});
|
|
1811
2090
|
return sent.data.responseCreatedPromise;
|
|
1812
2091
|
}
|
|
2092
|
+
async _resolveDirectoryImageAttachments(attachments) {
|
|
2093
|
+
const imagePromises = [];
|
|
2094
|
+
for (const attachment of attachments) {
|
|
2095
|
+
if (attachment.kind === "directory" && URI.isUri(attachment.value)) {
|
|
2096
|
+
imagePromises.push(this.chatAttachmentResolveService.resolveDirectoryImages(attachment.value));
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
if (imagePromises.length === 0) {
|
|
2100
|
+
return [];
|
|
2101
|
+
}
|
|
2102
|
+
const resolved = await Promise.all(imagePromises);
|
|
2103
|
+
return resolved.flat();
|
|
2104
|
+
}
|
|
1813
2105
|
async confirmPendingRequestsBeforeSend(model, options) {
|
|
1814
2106
|
if (options.queue) {
|
|
1815
2107
|
return true;
|
|
@@ -1820,16 +2112,16 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1820
2112
|
}
|
|
1821
2113
|
const promptResult = await this.dialogService.prompt({
|
|
1822
2114
|
type: "question",
|
|
1823
|
-
message: ( localize(
|
|
2115
|
+
message: ( localize(6684, "You already have pending requests.")),
|
|
1824
2116
|
detail: ( localize(
|
|
1825
|
-
|
|
2117
|
+
6685,
|
|
1826
2118
|
"Do you want to keep them in the queue or remove them before sending this message?"
|
|
1827
2119
|
)),
|
|
1828
2120
|
buttons: [{
|
|
1829
|
-
label: ( localize(
|
|
2121
|
+
label: ( localize(6686, "Keep Pending Requests")),
|
|
1830
2122
|
run: () => "keep"
|
|
1831
2123
|
}, {
|
|
1832
|
-
label: ( localize(
|
|
2124
|
+
label: ( localize(6687, "Remove Pending Requests")),
|
|
1833
2125
|
run: () => "remove"
|
|
1834
2126
|
}],
|
|
1835
2127
|
cancelButton: true
|
|
@@ -1845,9 +2137,21 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1845
2137
|
return true;
|
|
1846
2138
|
}
|
|
1847
2139
|
getModeRequestOptions() {
|
|
2140
|
+
const sessionResource = this.viewModel?.sessionResource;
|
|
2141
|
+
const userSelectedTools = this.input.selectedToolsModel.userSelectedTools;
|
|
2142
|
+
let lastToolsSnapshot = userSelectedTools.get();
|
|
2143
|
+
const scopedTools = derived(reader => {
|
|
2144
|
+
const activeSession = this._viewModelObs.read(reader)?.sessionResource;
|
|
2145
|
+
if (isEqual(activeSession, sessionResource)) {
|
|
2146
|
+
const tools = userSelectedTools.read(reader);
|
|
2147
|
+
lastToolsSnapshot = tools;
|
|
2148
|
+
return tools;
|
|
2149
|
+
}
|
|
2150
|
+
return lastToolsSnapshot;
|
|
2151
|
+
});
|
|
1848
2152
|
return {
|
|
1849
2153
|
modeInfo: this.input.currentModeInfo,
|
|
1850
|
-
userSelectedTools:
|
|
2154
|
+
userSelectedTools: scopedTools
|
|
1851
2155
|
};
|
|
1852
2156
|
}
|
|
1853
2157
|
getCodeBlockInfosForResponse(response) {
|
|
@@ -2035,11 +2339,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2035
2339
|
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are always enabled`);
|
|
2036
2340
|
const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
|
|
2037
2341
|
const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
|
|
2342
|
+
const sessionResource = this._viewModel?.model.sessionResource;
|
|
2038
2343
|
const computer = this.instantiationService.createInstance(
|
|
2039
2344
|
ComputeAutomaticInstructions,
|
|
2040
2345
|
this.input.currentModeKind,
|
|
2041
2346
|
enabledTools,
|
|
2042
|
-
enabledSubAgents
|
|
2347
|
+
enabledSubAgents,
|
|
2348
|
+
sessionResource
|
|
2043
2349
|
);
|
|
2044
2350
|
await computer.collect(attachedContext, CancellationToken.None);
|
|
2045
2351
|
}
|
|
@@ -2047,6 +2353,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2047
2353
|
this.listWidget.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
2048
2354
|
}
|
|
2049
2355
|
};
|
|
2050
|
-
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IEditorService)), ( __param(6, IConfigurationService)), ( __param(7, IDialogService)), ( __param(8, IContextKeyService)), ( __param(9, IInstantiationService)), ( __param(10, IChatService)), ( __param(11, IChatAgentService)), ( __param(12, IChatWidgetService)), ( __param(13, IChatAccessibilityService)), ( __param(14, ILogService)), ( __param(15, IThemeService)), ( __param(16, IChatSlashCommandService)), ( __param(17, IChatEditingService)), ( __param(18, ITelemetryService)), ( __param(19, IPromptsService)), ( __param(20, ILanguageModelToolsService)), ( __param(21, IChatModeService)), ( __param(22, IChatLayoutService)), ( __param(23, IChatEntitlementService)), ( __param(24, IChatSessionsService)), ( __param(25, IAgentSessionsService)), ( __param(26, IChatTodoListService)), ( __param(27, IWorkspaceContextService)), ( __param(28, ILifecycleService))], ChatWidget));
|
|
2356
|
+
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IEditorService)), ( __param(6, IConfigurationService)), ( __param(7, IDialogService)), ( __param(8, IContextKeyService)), ( __param(9, IInstantiationService)), ( __param(10, IChatService)), ( __param(11, IChatAgentService)), ( __param(12, IChatWidgetService)), ( __param(13, IChatAccessibilityService)), ( __param(14, ILogService)), ( __param(15, IThemeService)), ( __param(16, IChatSlashCommandService)), ( __param(17, IChatEditingService)), ( __param(18, ITelemetryService)), ( __param(19, IPromptsService)), ( __param(20, ILanguageModelToolsService)), ( __param(21, IChatModeService)), ( __param(22, IChatLayoutService)), ( __param(23, IChatEntitlementService)), ( __param(24, IChatSessionsService)), ( __param(25, IAgentSessionsService)), ( __param(26, IChatTodoListService)), ( __param(27, IWorkspaceContextService)), ( __param(28, ILifecycleService)), ( __param(29, IChatAttachmentResolveService)), ( __param(30, IChatTipService)), ( __param(31, IChatDebugService))], ChatWidget));
|
|
2051
2357
|
|
|
2052
2358
|
export { ChatWidget, isQuickChat };
|