@codingame/monaco-vscode-katex-common 27.0.0 → 28.0.1
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.js +2 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +30 -2
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +17 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +90 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +106 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +63 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +13 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +28 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +133 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +38 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +72 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.d.ts +1 -1
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.d.ts +59 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentParts.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownTableScrolling.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +26 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +290 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +6 -6
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +1 -1
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +22 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +12 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +3 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +6 -260
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +1 -1
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +129 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +56 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +20 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +43 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +42 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.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 +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +1 -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 +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +61 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +7 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +1 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +81 -191
- 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 +31 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +334 -181
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +51 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +16 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +213 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +10 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +174 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +2 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +12 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +36 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +19 -4
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +22 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +24 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +38 -46
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +6 -10
|
@@ -4,7 +4,7 @@ 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, clearNode, setVisibility, findParentWithClass, getTopLeftOffset, append, addStandardDisposableListener, EventType, addDisposableListener, scheduleAtNextAnimationFrame, getWindow, createElement, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
7
|
+
import { $ as $$1, clearNode, setVisibility, findParentWithClass, getTopLeftOffset, append, addStandardDisposableListener, EventType, addDisposableListener, isAncestor, scheduleAtNextAnimationFrame, getWindow, createElement, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
8
8
|
import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
9
9
|
import { timeout, disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
10
10
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
@@ -30,7 +30,6 @@ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core
|
|
|
30
30
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
31
31
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
32
32
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
33
|
-
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
34
33
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
35
34
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
36
35
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -40,10 +39,6 @@ import { bindContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
40
39
|
import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
|
|
41
40
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
42
41
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
43
|
-
import { WorkbenchState } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
44
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
45
|
-
import { EditorResourceAccessor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
46
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
47
42
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
48
43
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
49
44
|
import { checkModeOption } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
@@ -56,6 +51,7 @@ import { getModeNameForTelemetry, ChatMode } from '@codingame/monaco-vscode-api/
|
|
|
56
51
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
57
52
|
import { ChatRequestToolPart, ChatRequestToolSetPart, ChatRequestDynamicVariablePart, IParsedChatRequest, chatAgentLeader, chatSubcommandLeader, ChatRequestSlashPromptPart, formatChatQuestion, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
58
53
|
import { ChatRequestParser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatRequestParser';
|
|
54
|
+
import { getDynamicVariablesForWidget, getSelectedToolAndToolSetsForWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatVariables';
|
|
59
55
|
import { ChatRequestQueueKind, ChatSendResult } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
60
56
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
61
57
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
@@ -64,11 +60,10 @@ import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/wor
|
|
|
64
60
|
import { isWorkspaceVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, toPromptFileVariableEntry, PromptFileVariableKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
65
61
|
import { isResponseVM, isRequestVM, ChatViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
66
62
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
67
|
-
import { ChatModeKind, ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
63
|
+
import { ChatModeKind, ChatConfiguration, ChatPermissionLevel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
68
64
|
import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
69
65
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
70
66
|
import { ComputeAutomaticInstructions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
|
|
71
|
-
import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
72
67
|
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
73
68
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
74
69
|
import { GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID, handleModeSwitch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
@@ -113,9 +108,10 @@ const supportsAllAttachments = {
|
|
|
113
108
|
supportsProblemAttachments: true,
|
|
114
109
|
supportsSymbolAttachments: true,
|
|
115
110
|
supportsTerminalAttachments: true,
|
|
116
|
-
supportsPromptAttachments: true
|
|
111
|
+
supportsPromptAttachments: true,
|
|
112
|
+
supportsHandOffs: true
|
|
117
113
|
};
|
|
118
|
-
const DISCLAIMER = ( localize(
|
|
114
|
+
const DISCLAIMER = ( localize(6760, "AI responses may be inaccurate"));
|
|
119
115
|
let ChatWidget = class ChatWidget extends Disposable {
|
|
120
116
|
static {
|
|
121
117
|
ChatWidget_1 = this;
|
|
@@ -161,12 +157,18 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
161
157
|
parts: []
|
|
162
158
|
};
|
|
163
159
|
}
|
|
164
|
-
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequestWithReferences(
|
|
161
|
+
getDynamicVariablesForWidget(this),
|
|
162
|
+
getSelectedToolAndToolSetsForWidget(this),
|
|
163
|
+
this.getInput(),
|
|
164
|
+
this.location,
|
|
165
|
+
{
|
|
166
|
+
selectedAgent: this._lastSelectedAgent,
|
|
167
|
+
mode: this.input.currentModeKind,
|
|
168
|
+
attachmentCapabilities: this.attachmentCapabilities,
|
|
169
|
+
forcedAgent: this._lockedAgent?.id ? this.chatAgentService.getAgent(this._lockedAgent.id) : undefined
|
|
170
|
+
}
|
|
171
|
+
);
|
|
170
172
|
this._onDidChangeParsedInput.fire();
|
|
171
173
|
}
|
|
172
174
|
return this.parsedChatRequest;
|
|
@@ -189,7 +191,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
189
191
|
viewOptions,
|
|
190
192
|
styles,
|
|
191
193
|
codeEditorService,
|
|
192
|
-
editorService,
|
|
193
194
|
configurationService,
|
|
194
195
|
dialogService,
|
|
195
196
|
contextKeyService,
|
|
@@ -211,7 +212,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
211
212
|
chatSessionsService,
|
|
212
213
|
agentSessionsService,
|
|
213
214
|
chatTodoListService,
|
|
214
|
-
contextService,
|
|
215
215
|
lifecycleService,
|
|
216
216
|
chatAttachmentResolveService,
|
|
217
217
|
chatTipService,
|
|
@@ -221,7 +221,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
221
221
|
this.viewOptions = viewOptions;
|
|
222
222
|
this.styles = styles;
|
|
223
223
|
this.codeEditorService = codeEditorService;
|
|
224
|
-
this.editorService = editorService;
|
|
225
224
|
this.configurationService = configurationService;
|
|
226
225
|
this.dialogService = dialogService;
|
|
227
226
|
this.contextKeyService = contextKeyService;
|
|
@@ -242,7 +241,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
242
241
|
this.chatSessionsService = chatSessionsService;
|
|
243
242
|
this.agentSessionsService = agentSessionsService;
|
|
244
243
|
this.chatTodoListService = chatTodoListService;
|
|
245
|
-
this.contextService = contextService;
|
|
246
244
|
this.lifecycleService = lifecycleService;
|
|
247
245
|
this.chatAttachmentResolveService = chatAttachmentResolveService;
|
|
248
246
|
this.chatTipService = chatTipService;
|
|
@@ -287,9 +285,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
287
285
|
this._visible = false;
|
|
288
286
|
this._isRenderingWelcome = false;
|
|
289
287
|
this._attachmentCapabilities = supportsAllAttachments;
|
|
290
|
-
this.promptDescriptionsCache = ( new Map());
|
|
291
|
-
this.promptUriCache = ( new Map());
|
|
292
|
-
this._isLoadingPromptDescriptions = false;
|
|
293
288
|
this.viewModelDisposables = this._register(( new DisposableStore()));
|
|
294
289
|
this._editingSession = observableValue(this, undefined);
|
|
295
290
|
this._viewModelObs = observableFromEvent(this, this.onDidChangeViewModel, () => this.viewModel);
|
|
@@ -425,7 +420,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
425
420
|
this.renderChatEditingSessionState();
|
|
426
421
|
}));
|
|
427
422
|
this._register(
|
|
428
|
-
codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
|
|
423
|
+
this.codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
|
|
429
424
|
const resource = input.resource;
|
|
430
425
|
if (resource.scheme !== Schemas.vscodeChatCodeBlock) {
|
|
431
426
|
return null;
|
|
@@ -580,6 +575,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
580
575
|
renderStyle
|
|
581
576
|
});
|
|
582
577
|
this._register(addDisposableListener(parent, EventType.MOUSE_WHEEL, e => {
|
|
578
|
+
if (e.defaultPrevented) {
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
if (isAncestor(e.target, this.container)) {
|
|
582
|
+
return;
|
|
583
|
+
}
|
|
583
584
|
this.listWidget.delegateScrollFromMouseWheelEvent(e);
|
|
584
585
|
}));
|
|
585
586
|
this._register(autorun(reader => {
|
|
@@ -697,11 +698,17 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
697
698
|
return;
|
|
698
699
|
}
|
|
699
700
|
const previous = this.parsedChatRequest;
|
|
700
|
-
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
701
|
+
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).parseChatRequestWithReferences(
|
|
702
|
+
getDynamicVariablesForWidget(this),
|
|
703
|
+
getSelectedToolAndToolSetsForWidget(this),
|
|
704
|
+
this.getInput(),
|
|
705
|
+
this.location,
|
|
706
|
+
{
|
|
707
|
+
selectedAgent: this._lastSelectedAgent,
|
|
708
|
+
mode: this.input.currentModeKind,
|
|
709
|
+
attachmentCapabilities: this.attachmentCapabilities
|
|
710
|
+
}
|
|
711
|
+
);
|
|
705
712
|
if (!previous || !IParsedChatRequest.equals(previous, this.parsedChatRequest)) {
|
|
706
713
|
this._onDidChangeParsedInput.fire();
|
|
707
714
|
}
|
|
@@ -809,7 +816,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
809
816
|
if (this.chatEntitlementService.anonymous && !this.chatEntitlementService.sentiment.installed) {
|
|
810
817
|
const providers = product.defaultChatAgent.provider;
|
|
811
818
|
additionalMessage = ( new MarkdownString(( localize(
|
|
812
|
-
|
|
819
|
+
6761,
|
|
813
820
|
"By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3}).",
|
|
814
821
|
providers.default.name,
|
|
815
822
|
providers.default.name,
|
|
@@ -844,15 +851,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
844
851
|
return;
|
|
845
852
|
}
|
|
846
853
|
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
847
|
-
if (this._gettingStartedTipPart.value) {
|
|
848
|
-
setVisibility(true, tipContainer);
|
|
849
|
-
return;
|
|
850
|
-
}
|
|
851
854
|
const tip = this.chatTipService.getWelcomeTip(this.contextKeyService);
|
|
852
855
|
if (!tip) {
|
|
856
|
+
if (this._gettingStartedTipPart.value) {
|
|
857
|
+
this._gettingStartedTipPartRef = undefined;
|
|
858
|
+
this._gettingStartedTipPart.clear();
|
|
859
|
+
clearNode(tipContainer);
|
|
860
|
+
}
|
|
853
861
|
setVisibility(false, tipContainer);
|
|
854
862
|
return;
|
|
855
863
|
}
|
|
864
|
+
if (this._gettingStartedTipPart.value) {
|
|
865
|
+
setVisibility(true, tipContainer);
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
856
868
|
const store = ( new DisposableStore());
|
|
857
869
|
const renderer = this.instantiationService.createInstance(ChatContentMarkdownRenderer);
|
|
858
870
|
const tipPart = store.add(
|
|
@@ -885,7 +897,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
885
897
|
return ( new MarkdownString(""));
|
|
886
898
|
} else if (this._instructionFilesExist === false) {
|
|
887
899
|
return (new MarkdownString(localize(
|
|
888
|
-
|
|
900
|
+
6762,
|
|
889
901
|
"[Generate Agent Instructions]({0}) to onboard AI onto your codebase.",
|
|
890
902
|
`command:${GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID}`
|
|
891
903
|
), {
|
|
@@ -910,19 +922,19 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
910
922
|
const providerTitle = this._lockedAgent ? this.chatSessionsService.getWelcomeTitleForSessionType(this._lockedAgent.id) : undefined;
|
|
911
923
|
const providerMessage = this._lockedAgent ? this.chatSessionsService.getWelcomeMessageForSessionType(this._lockedAgent.id) : undefined;
|
|
912
924
|
const message = providerMessage ? ( new MarkdownString(providerMessage)) : (this._lockedAgent?.prefix === "@copilot " ? ( new MarkdownString(( localize(
|
|
913
|
-
|
|
925
|
+
6763,
|
|
914
926
|
"This chat session will be forwarded to the {0} [coding agent]({1}) where work is completed in the background. ",
|
|
915
927
|
this._lockedAgent.prefix,
|
|
916
928
|
"https://aka.ms/coding-agent-docs"
|
|
917
929
|
)) + DISCLAIMER, {
|
|
918
930
|
isTrusted: true
|
|
919
931
|
})) : ( new MarkdownString(( localize(
|
|
920
|
-
|
|
932
|
+
6764,
|
|
921
933
|
"This chat session will be forwarded to the {0} coding agent where work is completed in the background. ",
|
|
922
934
|
this._lockedAgent?.prefix
|
|
923
935
|
)) + DISCLAIMER)));
|
|
924
936
|
return {
|
|
925
|
-
title: providerTitle ?? ( localize(
|
|
937
|
+
title: providerTitle ?? ( localize(6765, "Delegate to {0}", this._lockedAgent?.prefix)),
|
|
926
938
|
message,
|
|
927
939
|
icon: providerIcon ?? Codicon.sendToRemoteAgent,
|
|
928
940
|
additionalMessage,
|
|
@@ -931,155 +943,19 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
931
943
|
}
|
|
932
944
|
let title;
|
|
933
945
|
if (this.input.currentModeKind === ChatModeKind.Ask) {
|
|
934
|
-
title = ( localize(
|
|
946
|
+
title = ( localize(6766, "Ask about your code"));
|
|
935
947
|
} else if (this.input.currentModeKind === ChatModeKind.Edit) {
|
|
936
|
-
title = ( localize(
|
|
948
|
+
title = ( localize(6767, "Edit in context"));
|
|
937
949
|
} else {
|
|
938
|
-
title = ( localize(
|
|
950
|
+
title = ( localize(6768, "Build with Agent"));
|
|
939
951
|
}
|
|
940
952
|
return {
|
|
941
953
|
title,
|
|
942
954
|
message: ( new MarkdownString(DISCLAIMER)),
|
|
943
955
|
icon: Codicon.chatSparkle,
|
|
944
|
-
additionalMessage
|
|
945
|
-
suggestedPrompts: this.getPromptFileSuggestions()
|
|
956
|
+
additionalMessage
|
|
946
957
|
};
|
|
947
958
|
}
|
|
948
|
-
getPromptFileSuggestions() {
|
|
949
|
-
if (!this.chatEntitlementService.sentiment.installed) {
|
|
950
|
-
const isEmpty = this.contextService.getWorkbenchState() === WorkbenchState.EMPTY;
|
|
951
|
-
if (isEmpty) {
|
|
952
|
-
return [{
|
|
953
|
-
icon: Codicon.vscode,
|
|
954
|
-
label: ( localize(6673, "Ask @vscode")),
|
|
955
|
-
prompt: ( localize(6674, "@vscode How do I change the theme to light mode?"))
|
|
956
|
-
}, {
|
|
957
|
-
icon: Codicon.newFolder,
|
|
958
|
-
label: ( localize(6675, "Create Project")),
|
|
959
|
-
prompt: ( localize(6676, "Create a #new Hello World project in TypeScript"))
|
|
960
|
-
}];
|
|
961
|
-
} else {
|
|
962
|
-
return [{
|
|
963
|
-
icon: Codicon.debugAlt,
|
|
964
|
-
label: ( localize(6677, "Build Workspace")),
|
|
965
|
-
prompt: ( localize(6678, "How do I build this workspace?"))
|
|
966
|
-
}, {
|
|
967
|
-
icon: Codicon.gear,
|
|
968
|
-
label: ( localize(6679, "Show Config")),
|
|
969
|
-
prompt: ( localize(6680, "Where is the configuration for this project defined?"))
|
|
970
|
-
}];
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
const activeEditor = this.editorService.activeEditor;
|
|
974
|
-
const resource = activeEditor ? EditorResourceAccessor.getOriginalUri(activeEditor) : undefined;
|
|
975
|
-
const suggestions = PromptsConfig.getPromptFilesRecommendationsValue(this.configurationService, resource);
|
|
976
|
-
if (!suggestions) {
|
|
977
|
-
return [];
|
|
978
|
-
}
|
|
979
|
-
const result = [];
|
|
980
|
-
const promptsToLoad = [];
|
|
981
|
-
for (const [promptName] of Object.entries(suggestions)) {
|
|
982
|
-
const description = this.promptDescriptionsCache.get(promptName);
|
|
983
|
-
if (description === undefined) {
|
|
984
|
-
promptsToLoad.push(promptName);
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
if (promptsToLoad.length > 0 && !this._isLoadingPromptDescriptions) {
|
|
988
|
-
this.loadPromptDescriptions(promptsToLoad);
|
|
989
|
-
return [];
|
|
990
|
-
}
|
|
991
|
-
const promptsWithScores = [];
|
|
992
|
-
for (const [promptName, condition] of Object.entries(suggestions)) {
|
|
993
|
-
let score = 0;
|
|
994
|
-
if (typeof condition === "boolean") {
|
|
995
|
-
score = condition ? 1 : 0;
|
|
996
|
-
}
|
|
997
|
-
else if (typeof condition === "string") {
|
|
998
|
-
try {
|
|
999
|
-
const whenClause = ContextKeyExpr.deserialize(condition);
|
|
1000
|
-
if (whenClause) {
|
|
1001
|
-
const allEditors = this.codeEditorService.listCodeEditors();
|
|
1002
|
-
if (allEditors.length > 0) {
|
|
1003
|
-
score = allEditors.reduce((count, editor) => {
|
|
1004
|
-
try {
|
|
1005
|
-
const editorContext = this.contextKeyService.getContext(editor.getDomNode());
|
|
1006
|
-
return count + (whenClause.evaluate(editorContext) ? 1 : 0);
|
|
1007
|
-
} catch (error) {
|
|
1008
|
-
this.logService.warn("Failed to evaluate when clause for editor:", error);
|
|
1009
|
-
return count;
|
|
1010
|
-
}
|
|
1011
|
-
}, 0);
|
|
1012
|
-
} else {
|
|
1013
|
-
score = this.contextKeyService.contextMatchesRules(whenClause) ? 1 : 0;
|
|
1014
|
-
}
|
|
1015
|
-
} else {
|
|
1016
|
-
score = 0;
|
|
1017
|
-
}
|
|
1018
|
-
} catch (error) {
|
|
1019
|
-
this.logService.warn(
|
|
1020
|
-
"Failed to parse when clause for prompt file suggestion:",
|
|
1021
|
-
condition,
|
|
1022
|
-
error
|
|
1023
|
-
);
|
|
1024
|
-
score = 0;
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
if (score > 0) {
|
|
1028
|
-
promptsWithScores.push({
|
|
1029
|
-
promptName,
|
|
1030
|
-
condition,
|
|
1031
|
-
score
|
|
1032
|
-
});
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
promptsWithScores.sort((a, b) => b.score - a.score);
|
|
1036
|
-
const topPrompts = promptsWithScores.slice(0, 5);
|
|
1037
|
-
for (const {
|
|
1038
|
-
promptName
|
|
1039
|
-
} of topPrompts) {
|
|
1040
|
-
const description = this.promptDescriptionsCache.get(promptName);
|
|
1041
|
-
const commandLabel = ( localize(6681, "{0}", promptName));
|
|
1042
|
-
const uri = this.promptUriCache.get(promptName);
|
|
1043
|
-
const descriptionText = description?.trim() ? description : undefined;
|
|
1044
|
-
result.push({
|
|
1045
|
-
icon: Codicon.run,
|
|
1046
|
-
label: commandLabel,
|
|
1047
|
-
description: descriptionText,
|
|
1048
|
-
prompt: `/${promptName} `,
|
|
1049
|
-
uri: uri
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
return result;
|
|
1053
|
-
}
|
|
1054
|
-
async loadPromptDescriptions(promptNames) {
|
|
1055
|
-
if (this._store.isDisposed) {
|
|
1056
|
-
return;
|
|
1057
|
-
}
|
|
1058
|
-
this._isLoadingPromptDescriptions = true;
|
|
1059
|
-
try {
|
|
1060
|
-
const promptCommands = await this.promptsService.getPromptSlashCommands(CancellationToken.None);
|
|
1061
|
-
let cacheUpdated = false;
|
|
1062
|
-
for (const promptCommand of promptCommands) {
|
|
1063
|
-
if (promptNames.includes(promptCommand.name)) {
|
|
1064
|
-
const description = promptCommand.description;
|
|
1065
|
-
if (description) {
|
|
1066
|
-
this.promptDescriptionsCache.set(promptCommand.name, description);
|
|
1067
|
-
cacheUpdated = true;
|
|
1068
|
-
} else {
|
|
1069
|
-
this.promptDescriptionsCache.set(promptCommand.name, "");
|
|
1070
|
-
cacheUpdated = true;
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
if (cacheUpdated) {
|
|
1075
|
-
this.renderWelcomeViewContentIfNeeded();
|
|
1076
|
-
}
|
|
1077
|
-
} catch (error) {
|
|
1078
|
-
this.logService.warn("Failed to load specific prompt descriptions:", error);
|
|
1079
|
-
} finally {
|
|
1080
|
-
this._isLoadingPromptDescriptions = false;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
959
|
async renderChatEditingSessionState() {
|
|
1084
960
|
if (!this.input) {
|
|
1085
961
|
return;
|
|
@@ -1098,7 +974,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1098
974
|
if (this.lifecycleService.willShutdown) {
|
|
1099
975
|
return;
|
|
1100
976
|
}
|
|
1101
|
-
if (this.isLockedToCodingAgent) {
|
|
977
|
+
if (this.isLockedToCodingAgent && !this._attachmentCapabilities.supportsHandOffs) {
|
|
1102
978
|
this.chatSuggestNextWidget.hide();
|
|
1103
979
|
return;
|
|
1104
980
|
}
|
|
@@ -1406,6 +1282,9 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1406
1282
|
rowContainer.appendChild(this.inputContainer);
|
|
1407
1283
|
this.createInput(this.inputContainer);
|
|
1408
1284
|
this.input.setChatMode(this.inputPart.currentModeObs.get().id);
|
|
1285
|
+
this.input.setPermissionLevel(
|
|
1286
|
+
this.inputPart.currentModeInfo.permissionLevel ?? ChatPermissionLevel.Default
|
|
1287
|
+
);
|
|
1409
1288
|
this.input.setEditing(true, isEditingSentRequest);
|
|
1410
1289
|
this._onDidChangeActiveInputEditor.fire();
|
|
1411
1290
|
} else {
|
|
@@ -1481,6 +1360,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1481
1360
|
const isInput = this.configurationService.getValue("chat.editRequests") === "input";
|
|
1482
1361
|
if (!isInput) {
|
|
1483
1362
|
this.inputPart.setChatMode(this.input.currentModeObs.get().id);
|
|
1363
|
+
this.inputPart.setPermissionLevel(this.input.currentModeInfo.permissionLevel ?? ChatPermissionLevel.Default);
|
|
1484
1364
|
const currentModel = this.input.selectedLanguageModel.get();
|
|
1485
1365
|
if (currentModel) {
|
|
1486
1366
|
this.inputPart.switchModel(currentModel.metadata);
|
|
@@ -1537,10 +1417,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1537
1417
|
renderWorkingSet: this.viewOptions.enableWorkingSet === "explicit",
|
|
1538
1418
|
supportsChangingModes: this.viewOptions.supportsChangingModes,
|
|
1539
1419
|
dndContainer: this.viewOptions.dndContainer,
|
|
1420
|
+
inputEditorMinLines: this.viewOptions.inputEditorMinLines,
|
|
1540
1421
|
widgetViewKindTag: this.getWidgetViewKindTag(),
|
|
1541
1422
|
defaultMode: this.viewOptions.defaultMode,
|
|
1542
1423
|
sessionTypePickerDelegate: this.viewOptions.sessionTypePickerDelegate,
|
|
1543
|
-
workspacePickerDelegate: this.viewOptions.workspacePickerDelegate
|
|
1424
|
+
workspacePickerDelegate: this.viewOptions.workspacePickerDelegate,
|
|
1425
|
+
isSessionsWindow: this.viewOptions.isSessionsWindow
|
|
1544
1426
|
};
|
|
1545
1427
|
if (this.viewModel?.editing) {
|
|
1546
1428
|
const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
|
|
@@ -1616,6 +1498,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1616
1498
|
this.renderFollowups();
|
|
1617
1499
|
this.renderChatSuggestNextWidget();
|
|
1618
1500
|
}));
|
|
1501
|
+
const foregroundSessionCountContextKeys = ( new Set([ChatContextKeys.foregroundSessionCount.key]));
|
|
1502
|
+
this._register(this.contextKeyService.onDidChangeContext(e => {
|
|
1503
|
+
if (e.affectsSome(foregroundSessionCountContextKeys) && this.isEmpty()) {
|
|
1504
|
+
this.renderGettingStartedTipIfNeeded();
|
|
1505
|
+
}
|
|
1506
|
+
}));
|
|
1619
1507
|
let previousModelIdentifier;
|
|
1620
1508
|
this._register(autorun(reader => {
|
|
1621
1509
|
const modelIdentifier = this.inputPart.selectedLanguageModel.read(reader)?.identifier;
|
|
@@ -1691,13 +1579,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1691
1579
|
clearNode(tipContainer);
|
|
1692
1580
|
setVisibility(false, tipContainer);
|
|
1693
1581
|
this._codeBlockModelCollection.clear();
|
|
1694
|
-
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1695
1582
|
this.inputPart.setInputModel(model.inputModel, model.getRequests().length === 0);
|
|
1583
|
+
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1696
1584
|
this.listWidget.setViewModel(this.viewModel);
|
|
1697
1585
|
if (this._lockedAgent) {
|
|
1698
1586
|
let placeholder = this.chatSessionsService.getInputPlaceholderForSessionType(this._lockedAgent.id);
|
|
1699
1587
|
if (!placeholder) {
|
|
1700
|
-
placeholder = ( localize(
|
|
1588
|
+
placeholder = ( localize(6769, "Chat with {0}", this._lockedAgent.id));
|
|
1701
1589
|
}
|
|
1702
1590
|
this.viewModel.setInputPlaceholder(placeholder);
|
|
1703
1591
|
this.inputEditor.updateOptions({
|
|
@@ -1743,7 +1631,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1743
1631
|
this._hasPendingRequestsContextKey.set(pendingCount > 0);
|
|
1744
1632
|
const steeringCount = pendingRequests.filter(pending => pending.kind === ChatRequestQueueKind.Steering).length;
|
|
1745
1633
|
if (announceSteering && steeringCount > 0 && lastSteeringCount === 0) {
|
|
1746
|
-
status(( localize(
|
|
1634
|
+
status(( localize(6770, "Steering")));
|
|
1747
1635
|
}
|
|
1748
1636
|
lastSteeringCount = steeringCount;
|
|
1749
1637
|
};
|
|
@@ -1882,7 +1770,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1882
1770
|
const options = {
|
|
1883
1771
|
attempt: lastRequest.attempt + 1,
|
|
1884
1772
|
location: this.location,
|
|
1885
|
-
userSelectedModelId: this.input.currentLanguageModel
|
|
1773
|
+
userSelectedModelId: this.input.currentLanguageModel,
|
|
1774
|
+
modeInfo: this.input.currentModeInfo
|
|
1886
1775
|
};
|
|
1887
1776
|
return await this.chatService.resendRequest(lastRequest, options);
|
|
1888
1777
|
}
|
|
@@ -1891,6 +1780,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1891
1780
|
if (!agentSlashPromptPart) {
|
|
1892
1781
|
return;
|
|
1893
1782
|
}
|
|
1783
|
+
this.chatTipService.recordSlashCommandUsage(agentSlashPromptPart.name);
|
|
1894
1784
|
const slashCommand = await this.promptsService.resolvePromptSlashCommand(agentSlashPromptPart.name, CancellationToken.None);
|
|
1895
1785
|
if (!slashCommand) {
|
|
1896
1786
|
return;
|
|
@@ -1963,7 +1853,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1963
1853
|
const editorValue = this.getInput();
|
|
1964
1854
|
const requestInputs = {
|
|
1965
1855
|
input: !query ? editorValue : query.query,
|
|
1966
|
-
attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext(
|
|
1856
|
+
attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext() : this.input.getAttachedAndImplicitContext()
|
|
1967
1857
|
};
|
|
1968
1858
|
const isUserQuery = !query;
|
|
1969
1859
|
const isEditing = this.viewModel?.editing;
|
|
@@ -1997,7 +1887,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1997
1887
|
}
|
|
1998
1888
|
await this._applyPromptFileIfSet(requestInputs);
|
|
1999
1889
|
await this._autoAttachInstructions(requestInputs);
|
|
2000
|
-
if (this.viewOptions.enableWorkingSet !== undefined && this.input.currentModeKind === ChatModeKind.Edit
|
|
1890
|
+
if (this.viewOptions.enableWorkingSet !== undefined && this.input.currentModeKind === ChatModeKind.Edit) {
|
|
2001
1891
|
const uniqueWorkingSetEntries = ( new ResourceSet());
|
|
2002
1892
|
const editingSessionAttachedContext = requestInputs.attachedContext;
|
|
2003
1893
|
const previousRequests = this.viewModel.model.getRequests();
|
|
@@ -2112,16 +2002,16 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2112
2002
|
}
|
|
2113
2003
|
const promptResult = await this.dialogService.prompt({
|
|
2114
2004
|
type: "question",
|
|
2115
|
-
message: ( localize(
|
|
2005
|
+
message: ( localize(6771, "You already have pending requests.")),
|
|
2116
2006
|
detail: ( localize(
|
|
2117
|
-
|
|
2007
|
+
6772,
|
|
2118
2008
|
"Do you want to keep them in the queue or remove them before sending this message?"
|
|
2119
2009
|
)),
|
|
2120
2010
|
buttons: [{
|
|
2121
|
-
label: ( localize(
|
|
2011
|
+
label: ( localize(6773, "Keep Pending Requests")),
|
|
2122
2012
|
run: () => "keep"
|
|
2123
2013
|
}, {
|
|
2124
|
-
label: ( localize(
|
|
2014
|
+
label: ( localize(6774, "Remove Pending Requests")),
|
|
2125
2015
|
run: () => "remove"
|
|
2126
2016
|
}],
|
|
2127
2017
|
cancelButton: true
|
|
@@ -2353,6 +2243,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2353
2243
|
this.listWidget.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
2354
2244
|
}
|
|
2355
2245
|
};
|
|
2356
|
-
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5,
|
|
2246
|
+
ChatWidget = ChatWidget_1 = ( __decorate([( __param(4, ICodeEditorService)), ( __param(5, IConfigurationService)), ( __param(6, IDialogService)), ( __param(7, IContextKeyService)), ( __param(8, IInstantiationService)), ( __param(9, IChatService)), ( __param(10, IChatAgentService)), ( __param(11, IChatWidgetService)), ( __param(12, IChatAccessibilityService)), ( __param(13, ILogService)), ( __param(14, IThemeService)), ( __param(15, IChatSlashCommandService)), ( __param(16, IChatEditingService)), ( __param(17, ITelemetryService)), ( __param(18, IPromptsService)), ( __param(19, ILanguageModelToolsService)), ( __param(20, IChatModeService)), ( __param(21, IChatLayoutService)), ( __param(22, IChatEntitlementService)), ( __param(23, IChatSessionsService)), ( __param(24, IAgentSessionsService)), ( __param(25, IChatTodoListService)), ( __param(26, ILifecycleService)), ( __param(27, IChatAttachmentResolveService)), ( __param(28, IChatTipService)), ( __param(29, IChatDebugService))], ChatWidget));
|
|
2357
2247
|
|
|
2358
2248
|
export { ChatWidget, isQuickChat };
|
|
@@ -45,7 +45,7 @@ let ChatFollowups = class ChatFollowups extends Disposable {
|
|
|
45
45
|
} else if (followup.kind === "command") {
|
|
46
46
|
button.element.classList.add("interactive-followup-command");
|
|
47
47
|
}
|
|
48
|
-
button.element.ariaLabel = ( localize(
|
|
48
|
+
button.element.ariaLabel = ( localize(6775, "Follow up question: {0}", baseTitle));
|
|
49
49
|
button.label = ( new MarkdownString(baseTitle));
|
|
50
50
|
this._register(button.onDidClick(() => this.clickHandler(followup)));
|
|
51
51
|
}
|