@codingame/monaco-vscode-katex-common 26.2.2 → 28.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 +37 -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 +576 -0
- package/vscode/src/vs/{workbench/contrib → 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.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +176 -17
- 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 +127 -64
- 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/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 +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +105 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +69 -43
- 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 +35 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +187 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +138 -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 +394 -87
- 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 +113 -116
- 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/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 +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +250 -132
- 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/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 +2 -4
- 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.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 +4 -2
- 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 +3 -2
- 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.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/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.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 +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- 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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +7 -6
- 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 +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +53 -20
- 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 +8 -7
- 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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +24 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +4 -4
- 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 +62 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +414 -129
- 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 +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +19 -12
- 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 +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.d.ts +1 -1
- 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.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 +11 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +252 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +246 -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 +6 -4
- 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.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.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 +65 -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 +356 -415
- 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 +68 -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 +5 -2
- 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.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 -2
- 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.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +57 -4
- 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 +24 -8
- 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 +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.d.ts +1 -1
- 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 +44 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +85 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +15 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +4 -2
- 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.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 +2 -2
- 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.d.ts +1 -1
- 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.d.ts +1 -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 +21 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +341 -88
- 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 +440 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +437 -241
- 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 +77 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +521 -284
- 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 +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +664 -0
- 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.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 +4 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +89 -49
- 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 +87 -0
- 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 +15 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +563 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +35 -26
- 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 +26 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +26 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +145 -79
- 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 +35 -15
- 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 +127 -30
- 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 +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +96 -34
- 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 +2 -44
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +28 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +84 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -41
- 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/terminal/browser/chatTerminalCommandMirror.js +6 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
|
@@ -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, isAncestor, 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,10 +26,10 @@ 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';
|
|
29
|
-
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
30
33
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
31
34
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
32
35
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -36,10 +39,6 @@ import { bindContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
36
39
|
import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
|
|
37
40
|
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
38
41
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
39
|
-
import { WorkbenchState } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
40
|
-
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
41
|
-
import { EditorResourceAccessor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
42
|
-
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
43
42
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
44
43
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
45
44
|
import { checkModeOption } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chat';
|
|
@@ -48,10 +47,11 @@ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
|
|
|
48
47
|
import { decidedChatEditingResourceContextKey, ModifiedFileEntryState, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey, inChatEditingSessionContextKey, applyingChatEditsFailedContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
49
48
|
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService.service';
|
|
50
49
|
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';
|
|
50
|
+
import { getModeNameForTelemetry, ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
52
51
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
53
52
|
import { ChatRequestToolPart, ChatRequestToolSetPart, ChatRequestDynamicVariablePart, IParsedChatRequest, chatAgentLeader, chatSubcommandLeader, ChatRequestSlashPromptPart, formatChatQuestion, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
54
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';
|
|
55
55
|
import { ChatRequestQueueKind, ChatSendResult } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
|
|
56
56
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
57
57
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
@@ -60,24 +60,31 @@ import { IChatTodoListService } from '@codingame/monaco-vscode-api/vscode/vs/wor
|
|
|
60
60
|
import { isWorkspaceVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, toPromptFileVariableEntry, PromptFileVariableKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
61
61
|
import { isResponseVM, isRequestVM, ChatViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
62
62
|
import { CodeBlockModelCollection } from '../../common/widget/codeBlockModelCollection.js';
|
|
63
|
-
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';
|
|
64
64
|
import { isToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
65
65
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
66
66
|
import { ComputeAutomaticInstructions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions';
|
|
67
|
-
import {
|
|
67
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
68
68
|
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';
|
|
69
|
+
import { GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID, handleModeSwitch } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
70
70
|
import { isIChatResourceViewContext, isIChatViewViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
71
71
|
import { IChatWidgetService, IChatAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
72
|
+
import { IChatAttachmentResolveService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service';
|
|
73
|
+
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables';
|
|
72
74
|
import { ChatSuggestNextWidget } from './chatContentParts/chatSuggestNextWidget.js';
|
|
73
75
|
import { ChatInputPart } from './input/chatInputPart.js';
|
|
74
76
|
import { ChatListWidget } from './chatListWidget.js';
|
|
75
77
|
import { ChatEditorOptions } from './chatOptions.js';
|
|
76
78
|
import { ChatViewWelcomePart } from '../viewsWelcome/chatViewWelcomeController.js';
|
|
79
|
+
import { IChatTipService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatTipService.service';
|
|
80
|
+
import { ChatTipContentPart } from './chatContentParts/chatTipContentPart.js';
|
|
81
|
+
import { ChatContentMarkdownRenderer } from './chatContentMarkdownRenderer.js';
|
|
77
82
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
83
|
+
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
78
84
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
79
85
|
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableFromEvent';
|
|
80
86
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
87
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
81
88
|
|
|
82
89
|
var ChatWidget_1;
|
|
83
90
|
registerCss(chat);
|
|
@@ -100,9 +107,11 @@ const supportsAllAttachments = {
|
|
|
100
107
|
supportsSourceControlAttachments: true,
|
|
101
108
|
supportsProblemAttachments: true,
|
|
102
109
|
supportsSymbolAttachments: true,
|
|
103
|
-
supportsTerminalAttachments: true
|
|
110
|
+
supportsTerminalAttachments: true,
|
|
111
|
+
supportsPromptAttachments: true,
|
|
112
|
+
supportsHandOffs: true
|
|
104
113
|
};
|
|
105
|
-
const DISCLAIMER = ( localize(
|
|
114
|
+
const DISCLAIMER = ( localize(6760, "AI responses may be inaccurate"));
|
|
106
115
|
let ChatWidget = class ChatWidget extends Disposable {
|
|
107
116
|
static {
|
|
108
117
|
ChatWidget_1 = this;
|
|
@@ -148,11 +157,18 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
148
157
|
parts: []
|
|
149
158
|
};
|
|
150
159
|
}
|
|
151
|
-
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
+
);
|
|
156
172
|
this._onDidChangeParsedInput.fire();
|
|
157
173
|
}
|
|
158
174
|
return this.parsedChatRequest;
|
|
@@ -175,7 +191,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
175
191
|
viewOptions,
|
|
176
192
|
styles,
|
|
177
193
|
codeEditorService,
|
|
178
|
-
editorService,
|
|
179
194
|
configurationService,
|
|
180
195
|
dialogService,
|
|
181
196
|
contextKeyService,
|
|
@@ -197,14 +212,15 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
197
212
|
chatSessionsService,
|
|
198
213
|
agentSessionsService,
|
|
199
214
|
chatTodoListService,
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
lifecycleService,
|
|
216
|
+
chatAttachmentResolveService,
|
|
217
|
+
chatTipService,
|
|
218
|
+
chatDebugService
|
|
202
219
|
) {
|
|
203
220
|
super();
|
|
204
221
|
this.viewOptions = viewOptions;
|
|
205
222
|
this.styles = styles;
|
|
206
223
|
this.codeEditorService = codeEditorService;
|
|
207
|
-
this.editorService = editorService;
|
|
208
224
|
this.configurationService = configurationService;
|
|
209
225
|
this.dialogService = dialogService;
|
|
210
226
|
this.contextKeyService = contextKeyService;
|
|
@@ -225,8 +241,10 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
225
241
|
this.chatSessionsService = chatSessionsService;
|
|
226
242
|
this.agentSessionsService = agentSessionsService;
|
|
227
243
|
this.chatTodoListService = chatTodoListService;
|
|
228
|
-
this.contextService = contextService;
|
|
229
244
|
this.lifecycleService = lifecycleService;
|
|
245
|
+
this.chatAttachmentResolveService = chatAttachmentResolveService;
|
|
246
|
+
this.chatTipService = chatTipService;
|
|
247
|
+
this.chatDebugService = chatDebugService;
|
|
230
248
|
this._onDidSubmitAgent = this._register(( new Emitter()));
|
|
231
249
|
this.onDidSubmitAgent = this._onDidSubmitAgent.event;
|
|
232
250
|
this._onDidChangeAgent = this._register(( new Emitter()));
|
|
@@ -245,11 +263,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
245
263
|
this.onDidShow = this._onDidShow.event;
|
|
246
264
|
this._onDidChangeParsedInput = this._register(( new Emitter()));
|
|
247
265
|
this.onDidChangeParsedInput = this._onDidChangeParsedInput.event;
|
|
248
|
-
this.
|
|
266
|
+
this._onDidChangeActiveInputEditor = this._register(( new Emitter()));
|
|
267
|
+
this.onDidChangeActiveInputEditor = this._onDidChangeActiveInputEditor.event;
|
|
268
|
+
this._onWillMaybeChangeHeight = this._register(( new Emitter()));
|
|
249
269
|
this.onWillMaybeChangeHeight = this._onWillMaybeChangeHeight.event;
|
|
250
270
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
251
271
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
252
|
-
this._onDidChangeContentHeight = ( new Emitter());
|
|
272
|
+
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
253
273
|
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
254
274
|
this._onDidChangeEmptyState = this._register(( new Emitter()));
|
|
255
275
|
this.onDidChangeEmptyState = this._onDidChangeEmptyState.event;
|
|
@@ -260,21 +280,27 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
260
280
|
this.inlineInputPartDisposable = this._register(( new MutableDisposable()));
|
|
261
281
|
this.recentlyRestoredCheckpoint = false;
|
|
262
282
|
this.welcomePart = this._register(( new MutableDisposable()));
|
|
283
|
+
this._gettingStartedTipPart = this._register(( new MutableDisposable()));
|
|
263
284
|
this.visibleChangeCount = 0;
|
|
264
285
|
this._visible = false;
|
|
265
286
|
this._isRenderingWelcome = false;
|
|
266
287
|
this._attachmentCapabilities = supportsAllAttachments;
|
|
267
|
-
this.promptDescriptionsCache = ( new Map());
|
|
268
|
-
this.promptUriCache = ( new Map());
|
|
269
|
-
this._isLoadingPromptDescriptions = false;
|
|
270
288
|
this.viewModelDisposables = this._register(( new DisposableStore()));
|
|
271
289
|
this._editingSession = observableValue(this, undefined);
|
|
290
|
+
this._viewModelObs = observableFromEvent(this, this.onDidChangeViewModel, () => this.viewModel);
|
|
272
291
|
this._lockedToCodingAgentContextKey = ChatContextKeys.lockedToCodingAgent.bindTo(this.contextKeyService);
|
|
273
292
|
this._agentSupportsAttachmentsContextKey = ChatContextKeys.agentSupportsAttachments.bindTo(this.contextKeyService);
|
|
274
293
|
this._sessionIsEmptyContextKey = ChatContextKeys.chatSessionIsEmpty.bindTo(this.contextKeyService);
|
|
275
294
|
this._hasPendingRequestsContextKey = ChatContextKeys.hasPendingRequests.bindTo(this.contextKeyService);
|
|
295
|
+
this._sessionHasDebugDataContextKey = ChatContextKeys.chatSessionHasDebugData.bindTo(this.contextKeyService);
|
|
296
|
+
this._register(this.chatDebugService.onDidAddEvent(e => {
|
|
297
|
+
const sessionResource = this.viewModel?.sessionResource;
|
|
298
|
+
if (sessionResource && ( e.sessionResource.toString()) === ( sessionResource.toString())) {
|
|
299
|
+
this._sessionHasDebugDataContextKey.set(true);
|
|
300
|
+
}
|
|
301
|
+
}));
|
|
276
302
|
this.viewContext = viewContext ?? {};
|
|
277
|
-
const viewModelObs =
|
|
303
|
+
const viewModelObs = this._viewModelObs;
|
|
278
304
|
if (typeof location === "object") {
|
|
279
305
|
this._location = location;
|
|
280
306
|
} else {
|
|
@@ -290,6 +316,21 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
290
316
|
this._register(
|
|
291
317
|
this.chatEntitlementService.onDidChangeAnonymous(() => this.renderWelcomeViewContentIfNeeded())
|
|
292
318
|
);
|
|
319
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
320
|
+
if (e.affectsConfiguration("chat.tips.enabled")) {
|
|
321
|
+
if (!this.configurationService.getValue("chat.tips.enabled")) {
|
|
322
|
+
if (this.inputPart) {
|
|
323
|
+
this._gettingStartedTipPartRef = undefined;
|
|
324
|
+
this._gettingStartedTipPart.clear();
|
|
325
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
326
|
+
clearNode(tipContainer);
|
|
327
|
+
setVisibility(false, tipContainer);
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
this.updateChatViewVisibility();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}));
|
|
293
334
|
this._register(
|
|
294
335
|
bindContextKey(decidedChatEditingResourceContextKey, contextKeyService, reader => {
|
|
295
336
|
const currentSession = this._editingSession.read(reader);
|
|
@@ -379,7 +420,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
379
420
|
this.renderChatEditingSessionState();
|
|
380
421
|
}));
|
|
381
422
|
this._register(
|
|
382
|
-
codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
|
|
423
|
+
this.codeEditorService.registerCodeEditorOpenHandler(async (input, _source, _sideBySide) => {
|
|
383
424
|
const resource = input.resource;
|
|
384
425
|
if (resource.scheme !== Schemas.vscodeChatCodeBlock) {
|
|
385
426
|
return null;
|
|
@@ -469,6 +510,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
469
510
|
get contentHeight() {
|
|
470
511
|
return this.input.height.get() + this.listWidget.contentHeight + this.chatSuggestNextWidget.height;
|
|
471
512
|
}
|
|
513
|
+
get scrollTop() {
|
|
514
|
+
return this.listWidget.scrollTop;
|
|
515
|
+
}
|
|
516
|
+
set scrollTop(value) {
|
|
517
|
+
this.listWidget.scrollTop = value;
|
|
518
|
+
}
|
|
472
519
|
get attachmentModel() {
|
|
473
520
|
return this.input.attachmentModel;
|
|
474
521
|
}
|
|
@@ -527,6 +574,15 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
527
574
|
...this.viewOptions.rendererOptions,
|
|
528
575
|
renderStyle
|
|
529
576
|
});
|
|
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
|
+
}
|
|
584
|
+
this.listWidget.delegateScrollFromMouseWheelEvent(e);
|
|
585
|
+
}));
|
|
530
586
|
this._register(autorun(reader => {
|
|
531
587
|
const fontFamily = this.chatLayoutService.fontFamily.read(reader);
|
|
532
588
|
const fontSize = this.chatLayoutService.fontSize.read(reader);
|
|
@@ -579,6 +635,61 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
579
635
|
this.input.focus();
|
|
580
636
|
this._onDidFocus.fire();
|
|
581
637
|
}
|
|
638
|
+
focusTodosView() {
|
|
639
|
+
if (!this.input.hasVisibleTodos()) {
|
|
640
|
+
return false;
|
|
641
|
+
}
|
|
642
|
+
return this.input.focusTodoList();
|
|
643
|
+
}
|
|
644
|
+
toggleTodosViewFocus() {
|
|
645
|
+
if (!this.input.hasVisibleTodos()) {
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
if (this.input.isTodoListFocused()) {
|
|
649
|
+
this.focusInput();
|
|
650
|
+
return true;
|
|
651
|
+
}
|
|
652
|
+
return this.input.focusTodoList();
|
|
653
|
+
}
|
|
654
|
+
focusQuestionCarousel() {
|
|
655
|
+
if (!this.input.questionCarousel) {
|
|
656
|
+
return false;
|
|
657
|
+
}
|
|
658
|
+
return this.input.focusQuestionCarousel();
|
|
659
|
+
}
|
|
660
|
+
toggleQuestionCarouselFocus() {
|
|
661
|
+
if (!this.input.questionCarousel) {
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
if (this.input.isQuestionCarouselFocused()) {
|
|
665
|
+
this.focusInput();
|
|
666
|
+
return true;
|
|
667
|
+
}
|
|
668
|
+
return this.input.focusQuestionCarousel();
|
|
669
|
+
}
|
|
670
|
+
navigateToPreviousQuestion() {
|
|
671
|
+
if (!this.input.questionCarousel) {
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
return this.input.navigateToPreviousQuestion();
|
|
675
|
+
}
|
|
676
|
+
navigateToNextQuestion() {
|
|
677
|
+
if (!this.input.questionCarousel) {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
return this.input.navigateToNextQuestion();
|
|
681
|
+
}
|
|
682
|
+
toggleTipFocus() {
|
|
683
|
+
if (this._gettingStartedTipPartRef?.hasFocus()) {
|
|
684
|
+
this.focusInput();
|
|
685
|
+
return true;
|
|
686
|
+
}
|
|
687
|
+
if (!this._gettingStartedTipPartRef) {
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
this._gettingStartedTipPartRef.focus();
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
582
693
|
hasInputFocus() {
|
|
583
694
|
return this.input.hasFocus();
|
|
584
695
|
}
|
|
@@ -587,10 +698,17 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
587
698
|
return;
|
|
588
699
|
}
|
|
589
700
|
const previous = this.parsedChatRequest;
|
|
590
|
-
this.parsedChatRequest = this.instantiationService.createInstance(ChatRequestParser).
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
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
|
+
);
|
|
594
712
|
if (!previous || !IParsedChatRequest.equals(previous, this.parsedChatRequest)) {
|
|
595
713
|
this._onDidChangeParsedInput.fire();
|
|
596
714
|
}
|
|
@@ -657,10 +775,26 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
657
775
|
}
|
|
658
776
|
updateChatViewVisibility() {
|
|
659
777
|
if (this.viewModel) {
|
|
778
|
+
const isStandardLayout = this.viewOptions.renderStyle !== "compact" && this.viewOptions.renderStyle !== "minimal";
|
|
660
779
|
const numItems = this.viewModel.getItems().length;
|
|
661
780
|
setVisibility(numItems === 0, this.welcomeMessageContainer);
|
|
662
781
|
setVisibility(numItems !== 0, this.listContainer);
|
|
782
|
+
if (isStandardLayout && this.inputPart) {
|
|
783
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
784
|
+
if (numItems === 0) {
|
|
785
|
+
this.renderGettingStartedTipIfNeeded();
|
|
786
|
+
} else {
|
|
787
|
+
this._gettingStartedTipPartRef = undefined;
|
|
788
|
+
this._gettingStartedTipPart.clear();
|
|
789
|
+
clearNode(tipContainer);
|
|
790
|
+
setVisibility(false, tipContainer);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
663
793
|
}
|
|
794
|
+
this.container.classList.toggle(
|
|
795
|
+
"chat-view-getting-started-disabled",
|
|
796
|
+
this.chatEntitlementService.sentiment.installed
|
|
797
|
+
);
|
|
664
798
|
this._onDidChangeEmptyState.fire();
|
|
665
799
|
}
|
|
666
800
|
isEmpty() {
|
|
@@ -682,7 +816,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
682
816
|
if (this.chatEntitlementService.anonymous && !this.chatEntitlementService.sentiment.installed) {
|
|
683
817
|
const providers = product.defaultChatAgent.provider;
|
|
684
818
|
additionalMessage = ( new MarkdownString(( localize(
|
|
685
|
-
|
|
819
|
+
6761,
|
|
686
820
|
"By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3}).",
|
|
687
821
|
providers.default.name,
|
|
688
822
|
providers.default.name,
|
|
@@ -712,6 +846,42 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
712
846
|
this._isRenderingWelcome = false;
|
|
713
847
|
}
|
|
714
848
|
}
|
|
849
|
+
renderGettingStartedTipIfNeeded() {
|
|
850
|
+
if (!this.inputPart) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
854
|
+
const tip = this.chatTipService.getWelcomeTip(this.contextKeyService);
|
|
855
|
+
if (!tip) {
|
|
856
|
+
if (this._gettingStartedTipPart.value) {
|
|
857
|
+
this._gettingStartedTipPartRef = undefined;
|
|
858
|
+
this._gettingStartedTipPart.clear();
|
|
859
|
+
clearNode(tipContainer);
|
|
860
|
+
}
|
|
861
|
+
setVisibility(false, tipContainer);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
if (this._gettingStartedTipPart.value) {
|
|
865
|
+
setVisibility(true, tipContainer);
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
const store = ( new DisposableStore());
|
|
869
|
+
const renderer = this.instantiationService.createInstance(ChatContentMarkdownRenderer);
|
|
870
|
+
const tipPart = store.add(
|
|
871
|
+
this.instantiationService.createInstance(ChatTipContentPart, tip, renderer)
|
|
872
|
+
);
|
|
873
|
+
tipContainer.appendChild(tipPart.domNode);
|
|
874
|
+
this._gettingStartedTipPartRef = tipPart;
|
|
875
|
+
store.add(tipPart.onDidHide(() => {
|
|
876
|
+
tipPart.domNode.remove();
|
|
877
|
+
this._gettingStartedTipPartRef = undefined;
|
|
878
|
+
this._gettingStartedTipPart.clear();
|
|
879
|
+
setVisibility(false, tipContainer);
|
|
880
|
+
this.focusInput();
|
|
881
|
+
}));
|
|
882
|
+
this._gettingStartedTipPart.value = store;
|
|
883
|
+
setVisibility(true, tipContainer);
|
|
884
|
+
}
|
|
715
885
|
_getGenerateInstructionsMessage() {
|
|
716
886
|
if (!this._instructionFilesCheckPromise) {
|
|
717
887
|
this._instructionFilesCheckPromise = this._checkForAgentInstructionFiles();
|
|
@@ -726,14 +896,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
726
896
|
if (this._instructionFilesExist === true) {
|
|
727
897
|
return ( new MarkdownString(""));
|
|
728
898
|
} else if (this._instructionFilesExist === false) {
|
|
729
|
-
const generateInstructionsCommand = "workbench.action.chat.generateInstructions";
|
|
730
899
|
return (new MarkdownString(localize(
|
|
731
|
-
|
|
900
|
+
6762,
|
|
732
901
|
"[Generate Agent Instructions]({0}) to onboard AI onto your codebase.",
|
|
733
|
-
`command:${
|
|
902
|
+
`command:${GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID}`
|
|
734
903
|
), {
|
|
735
904
|
isTrusted: {
|
|
736
|
-
enabledCommands: [
|
|
905
|
+
enabledCommands: [GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID]
|
|
737
906
|
}
|
|
738
907
|
}));
|
|
739
908
|
}
|
|
@@ -753,19 +922,19 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
753
922
|
const providerTitle = this._lockedAgent ? this.chatSessionsService.getWelcomeTitleForSessionType(this._lockedAgent.id) : undefined;
|
|
754
923
|
const providerMessage = this._lockedAgent ? this.chatSessionsService.getWelcomeMessageForSessionType(this._lockedAgent.id) : undefined;
|
|
755
924
|
const message = providerMessage ? ( new MarkdownString(providerMessage)) : (this._lockedAgent?.prefix === "@copilot " ? ( new MarkdownString(( localize(
|
|
756
|
-
|
|
925
|
+
6763,
|
|
757
926
|
"This chat session will be forwarded to the {0} [coding agent]({1}) where work is completed in the background. ",
|
|
758
927
|
this._lockedAgent.prefix,
|
|
759
928
|
"https://aka.ms/coding-agent-docs"
|
|
760
929
|
)) + DISCLAIMER, {
|
|
761
930
|
isTrusted: true
|
|
762
931
|
})) : ( new MarkdownString(( localize(
|
|
763
|
-
|
|
932
|
+
6764,
|
|
764
933
|
"This chat session will be forwarded to the {0} coding agent where work is completed in the background. ",
|
|
765
934
|
this._lockedAgent?.prefix
|
|
766
935
|
)) + DISCLAIMER)));
|
|
767
936
|
return {
|
|
768
|
-
title: providerTitle ?? ( localize(
|
|
937
|
+
title: providerTitle ?? ( localize(6765, "Delegate to {0}", this._lockedAgent?.prefix)),
|
|
769
938
|
message,
|
|
770
939
|
icon: providerIcon ?? Codicon.sendToRemoteAgent,
|
|
771
940
|
additionalMessage,
|
|
@@ -774,155 +943,19 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
774
943
|
}
|
|
775
944
|
let title;
|
|
776
945
|
if (this.input.currentModeKind === ChatModeKind.Ask) {
|
|
777
|
-
title = ( localize(
|
|
946
|
+
title = ( localize(6766, "Ask about your code"));
|
|
778
947
|
} else if (this.input.currentModeKind === ChatModeKind.Edit) {
|
|
779
|
-
title = ( localize(
|
|
948
|
+
title = ( localize(6767, "Edit in context"));
|
|
780
949
|
} else {
|
|
781
|
-
title = ( localize(
|
|
950
|
+
title = ( localize(6768, "Build with Agent"));
|
|
782
951
|
}
|
|
783
952
|
return {
|
|
784
953
|
title,
|
|
785
954
|
message: ( new MarkdownString(DISCLAIMER)),
|
|
786
955
|
icon: Codicon.chatSparkle,
|
|
787
|
-
additionalMessage
|
|
788
|
-
suggestedPrompts: this.getPromptFileSuggestions()
|
|
956
|
+
additionalMessage
|
|
789
957
|
};
|
|
790
958
|
}
|
|
791
|
-
getPromptFileSuggestions() {
|
|
792
|
-
if (!this.chatEntitlementService.sentiment.installed) {
|
|
793
|
-
const isEmpty = this.contextService.getWorkbenchState() === WorkbenchState.EMPTY;
|
|
794
|
-
if (isEmpty) {
|
|
795
|
-
return [{
|
|
796
|
-
icon: Codicon.vscode,
|
|
797
|
-
label: ( localize(6140, "Ask @vscode")),
|
|
798
|
-
prompt: ( localize(6141, "@vscode How do I change the theme to light mode?"))
|
|
799
|
-
}, {
|
|
800
|
-
icon: Codicon.newFolder,
|
|
801
|
-
label: ( localize(6142, "Create Project")),
|
|
802
|
-
prompt: ( localize(6143, "Create a #new Hello World project in TypeScript"))
|
|
803
|
-
}];
|
|
804
|
-
} else {
|
|
805
|
-
return [{
|
|
806
|
-
icon: Codicon.debugAlt,
|
|
807
|
-
label: ( localize(6144, "Build Workspace")),
|
|
808
|
-
prompt: ( localize(6145, "How do I build this workspace?"))
|
|
809
|
-
}, {
|
|
810
|
-
icon: Codicon.gear,
|
|
811
|
-
label: ( localize(6146, "Show Config")),
|
|
812
|
-
prompt: ( localize(6147, "Where is the configuration for this project defined?"))
|
|
813
|
-
}];
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
const activeEditor = this.editorService.activeEditor;
|
|
817
|
-
const resource = activeEditor ? EditorResourceAccessor.getOriginalUri(activeEditor) : undefined;
|
|
818
|
-
const suggestions = PromptsConfig.getPromptFilesRecommendationsValue(this.configurationService, resource);
|
|
819
|
-
if (!suggestions) {
|
|
820
|
-
return [];
|
|
821
|
-
}
|
|
822
|
-
const result = [];
|
|
823
|
-
const promptsToLoad = [];
|
|
824
|
-
for (const [promptName] of Object.entries(suggestions)) {
|
|
825
|
-
const description = this.promptDescriptionsCache.get(promptName);
|
|
826
|
-
if (description === undefined) {
|
|
827
|
-
promptsToLoad.push(promptName);
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
if (promptsToLoad.length > 0 && !this._isLoadingPromptDescriptions) {
|
|
831
|
-
this.loadPromptDescriptions(promptsToLoad);
|
|
832
|
-
return [];
|
|
833
|
-
}
|
|
834
|
-
const promptsWithScores = [];
|
|
835
|
-
for (const [promptName, condition] of Object.entries(suggestions)) {
|
|
836
|
-
let score = 0;
|
|
837
|
-
if (typeof condition === "boolean") {
|
|
838
|
-
score = condition ? 1 : 0;
|
|
839
|
-
}
|
|
840
|
-
else if (typeof condition === "string") {
|
|
841
|
-
try {
|
|
842
|
-
const whenClause = ContextKeyExpr.deserialize(condition);
|
|
843
|
-
if (whenClause) {
|
|
844
|
-
const allEditors = this.codeEditorService.listCodeEditors();
|
|
845
|
-
if (allEditors.length > 0) {
|
|
846
|
-
score = allEditors.reduce((count, editor) => {
|
|
847
|
-
try {
|
|
848
|
-
const editorContext = this.contextKeyService.getContext(editor.getDomNode());
|
|
849
|
-
return count + (whenClause.evaluate(editorContext) ? 1 : 0);
|
|
850
|
-
} catch (error) {
|
|
851
|
-
this.logService.warn("Failed to evaluate when clause for editor:", error);
|
|
852
|
-
return count;
|
|
853
|
-
}
|
|
854
|
-
}, 0);
|
|
855
|
-
} else {
|
|
856
|
-
score = this.contextKeyService.contextMatchesRules(whenClause) ? 1 : 0;
|
|
857
|
-
}
|
|
858
|
-
} else {
|
|
859
|
-
score = 0;
|
|
860
|
-
}
|
|
861
|
-
} catch (error) {
|
|
862
|
-
this.logService.warn(
|
|
863
|
-
"Failed to parse when clause for prompt file suggestion:",
|
|
864
|
-
condition,
|
|
865
|
-
error
|
|
866
|
-
);
|
|
867
|
-
score = 0;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
if (score > 0) {
|
|
871
|
-
promptsWithScores.push({
|
|
872
|
-
promptName,
|
|
873
|
-
condition,
|
|
874
|
-
score
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
promptsWithScores.sort((a, b) => b.score - a.score);
|
|
879
|
-
const topPrompts = promptsWithScores.slice(0, 5);
|
|
880
|
-
for (const {
|
|
881
|
-
promptName
|
|
882
|
-
} of topPrompts) {
|
|
883
|
-
const description = this.promptDescriptionsCache.get(promptName);
|
|
884
|
-
const commandLabel = ( localize(6148, "{0}", promptName));
|
|
885
|
-
const uri = this.promptUriCache.get(promptName);
|
|
886
|
-
const descriptionText = description?.trim() ? description : undefined;
|
|
887
|
-
result.push({
|
|
888
|
-
icon: Codicon.run,
|
|
889
|
-
label: commandLabel,
|
|
890
|
-
description: descriptionText,
|
|
891
|
-
prompt: `/${promptName} `,
|
|
892
|
-
uri: uri
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
return result;
|
|
896
|
-
}
|
|
897
|
-
async loadPromptDescriptions(promptNames) {
|
|
898
|
-
if (this._store.isDisposed) {
|
|
899
|
-
return;
|
|
900
|
-
}
|
|
901
|
-
this._isLoadingPromptDescriptions = true;
|
|
902
|
-
try {
|
|
903
|
-
const promptCommands = await this.promptsService.getPromptSlashCommands(CancellationToken.None);
|
|
904
|
-
let cacheUpdated = false;
|
|
905
|
-
for (const promptCommand of promptCommands) {
|
|
906
|
-
if (promptNames.includes(promptCommand.name)) {
|
|
907
|
-
const description = promptCommand.description;
|
|
908
|
-
if (description) {
|
|
909
|
-
this.promptDescriptionsCache.set(promptCommand.name, description);
|
|
910
|
-
cacheUpdated = true;
|
|
911
|
-
} else {
|
|
912
|
-
this.promptDescriptionsCache.set(promptCommand.name, "");
|
|
913
|
-
cacheUpdated = true;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
if (cacheUpdated) {
|
|
918
|
-
this.renderWelcomeViewContentIfNeeded();
|
|
919
|
-
}
|
|
920
|
-
} catch (error) {
|
|
921
|
-
this.logService.warn("Failed to load specific prompt descriptions:", error);
|
|
922
|
-
} finally {
|
|
923
|
-
this._isLoadingPromptDescriptions = false;
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
959
|
async renderChatEditingSessionState() {
|
|
927
960
|
if (!this.input) {
|
|
928
961
|
return;
|
|
@@ -941,7 +974,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
941
974
|
if (this.lifecycleService.willShutdown) {
|
|
942
975
|
return;
|
|
943
976
|
}
|
|
944
|
-
if (this.isLockedToCodingAgent) {
|
|
977
|
+
if (this.isLockedToCodingAgent && !this._attachmentCapabilities.supportsHandOffs) {
|
|
945
978
|
this.chatSuggestNextWidget.hide();
|
|
946
979
|
return;
|
|
947
980
|
}
|
|
@@ -962,7 +995,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
962
995
|
this.chatSuggestNextWidget.render(currentMode);
|
|
963
996
|
if (wasHidden) {
|
|
964
997
|
this.telemetryService.publicLog2("chat.handoffWidgetShown", {
|
|
965
|
-
agent: currentMode
|
|
998
|
+
agent: getModeNameForTelemetry(currentMode),
|
|
966
999
|
handoffCount: handoffs.length
|
|
967
1000
|
});
|
|
968
1001
|
}
|
|
@@ -977,10 +1010,10 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
977
1010
|
this.chatSuggestNextWidget.hide();
|
|
978
1011
|
const promptToUse = handoff.prompt;
|
|
979
1012
|
const currentMode = this.input.currentModeObs.get();
|
|
980
|
-
const
|
|
1013
|
+
const toMode = handoff.agent ? this.chatModeService.findModeByName(handoff.agent) : undefined;
|
|
981
1014
|
this.telemetryService.publicLog2("chat.handoffClicked", {
|
|
982
|
-
fromAgent:
|
|
983
|
-
toAgent: agentId ||
|
|
1015
|
+
fromAgent: getModeNameForTelemetry(currentMode),
|
|
1016
|
+
toAgent: agentId || (toMode ? getModeNameForTelemetry(toMode) : ""),
|
|
984
1017
|
hasPrompt: Boolean(promptToUse),
|
|
985
1018
|
autoSend: Boolean(handoff.send)
|
|
986
1019
|
});
|
|
@@ -1004,40 +1037,64 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1004
1037
|
if (!this._shouldExitAfterDelegation(sourceAgent, targetAgent)) {
|
|
1005
1038
|
return;
|
|
1006
1039
|
}
|
|
1040
|
+
this.logService.debug(
|
|
1041
|
+
`[Delegation] Will exit after delegation: sourceAgent=${sourceAgent?.id}, targetAgent=${targetAgent?.id}`
|
|
1042
|
+
);
|
|
1007
1043
|
try {
|
|
1008
1044
|
await this._handleDelegationExit();
|
|
1009
1045
|
} catch (e) {
|
|
1010
|
-
this.logService.error("Failed to handle delegation exit", e);
|
|
1046
|
+
this.logService.error("[Delegation] Failed to handle delegation exit", e);
|
|
1011
1047
|
}
|
|
1012
1048
|
}
|
|
1013
1049
|
_shouldExitAfterDelegation(sourceAgent, targetAgent) {
|
|
1014
1050
|
if (!targetAgent) {
|
|
1051
|
+
this.logService.debug("[Delegation] _shouldExitAfterDelegation: false (no targetAgent)");
|
|
1015
1052
|
return false;
|
|
1016
1053
|
}
|
|
1017
1054
|
if (!this.configurationService.getValue(ChatConfiguration.ExitAfterDelegation)) {
|
|
1055
|
+
this.logService.debug(
|
|
1056
|
+
"[Delegation] _shouldExitAfterDelegation: false (ExitAfterDelegation config disabled)"
|
|
1057
|
+
);
|
|
1018
1058
|
return false;
|
|
1019
1059
|
}
|
|
1020
1060
|
if (sourceAgent && sourceAgent.id === targetAgent.id) {
|
|
1061
|
+
this.logService.debug(
|
|
1062
|
+
"[Delegation] _shouldExitAfterDelegation: false (source and target agents are the same)"
|
|
1063
|
+
);
|
|
1021
1064
|
return false;
|
|
1022
1065
|
}
|
|
1023
1066
|
if (!isIChatViewViewContext(this.viewContext)) {
|
|
1067
|
+
this.logService.debug(
|
|
1068
|
+
"[Delegation] _shouldExitAfterDelegation: false (not in chat view context)"
|
|
1069
|
+
);
|
|
1024
1070
|
return false;
|
|
1025
1071
|
}
|
|
1026
1072
|
const contribution = this.chatSessionsService.getChatSessionContribution(targetAgent.id);
|
|
1027
1073
|
if (!contribution) {
|
|
1074
|
+
this.logService.debug(
|
|
1075
|
+
`[Delegation] _shouldExitAfterDelegation: false (no contribution found for targetAgent.id=${targetAgent.id})`
|
|
1076
|
+
);
|
|
1028
1077
|
return false;
|
|
1029
1078
|
}
|
|
1030
1079
|
if (contribution.canDelegate !== true) {
|
|
1080
|
+
this.logService.debug(
|
|
1081
|
+
`[Delegation] _shouldExitAfterDelegation: false (contribution.canDelegate=${contribution.canDelegate}, expected true)`
|
|
1082
|
+
);
|
|
1031
1083
|
return false;
|
|
1032
1084
|
}
|
|
1085
|
+
this.logService.debug("[Delegation] _shouldExitAfterDelegation: true");
|
|
1033
1086
|
return true;
|
|
1034
1087
|
}
|
|
1035
1088
|
async _handleDelegationExit() {
|
|
1036
1089
|
const viewModel = this.viewModel;
|
|
1037
1090
|
if (!viewModel) {
|
|
1091
|
+
this.logService.debug("[Delegation] _handleDelegationExit: no viewModel, returning");
|
|
1038
1092
|
return;
|
|
1039
1093
|
}
|
|
1040
1094
|
const parentSessionResource = viewModel.sessionResource;
|
|
1095
|
+
this.logService.debug(
|
|
1096
|
+
`[Delegation] _handleDelegationExit: parentSessionResource=${( parentSessionResource.toString())}`
|
|
1097
|
+
);
|
|
1041
1098
|
const checkIfShouldClear = () => {
|
|
1042
1099
|
const items = viewModel.getItems();
|
|
1043
1100
|
const lastItem = items[items.length - 1];
|
|
@@ -1048,10 +1105,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1048
1105
|
return false;
|
|
1049
1106
|
};
|
|
1050
1107
|
if (checkIfShouldClear()) {
|
|
1108
|
+
this.logService.debug("[Delegation] Response complete, archiving session before clearing");
|
|
1109
|
+
await this.archiveLocalParentSession(parentSessionResource);
|
|
1051
1110
|
await this.clear();
|
|
1052
|
-
this.archiveLocalParentSession(parentSessionResource);
|
|
1053
1111
|
return;
|
|
1054
1112
|
}
|
|
1113
|
+
this.logService.debug("[Delegation] Waiting for response to complete...");
|
|
1055
1114
|
const shouldClear = await ( new Promise(resolve => {
|
|
1056
1115
|
const disposable = viewModel.onDidChange(() => {
|
|
1057
1116
|
const result = checkIfShouldClear();
|
|
@@ -1061,6 +1120,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1061
1120
|
}
|
|
1062
1121
|
});
|
|
1063
1122
|
const timeout = setTimeout(() => {
|
|
1123
|
+
this.logService.debug("[Delegation] Timeout waiting for response to complete");
|
|
1064
1124
|
cleanup();
|
|
1065
1125
|
resolve(false);
|
|
1066
1126
|
}, 30_000);
|
|
@@ -1070,17 +1130,30 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1070
1130
|
};
|
|
1071
1131
|
}));
|
|
1072
1132
|
if (shouldClear) {
|
|
1133
|
+
this.logService.debug("[Delegation] Response completed, archiving session before clearing");
|
|
1134
|
+
await this.archiveLocalParentSession(parentSessionResource);
|
|
1073
1135
|
await this.clear();
|
|
1074
|
-
|
|
1136
|
+
} else {
|
|
1137
|
+
this.logService.debug("[Delegation] Not clearing (timeout or error)");
|
|
1075
1138
|
}
|
|
1076
1139
|
}
|
|
1077
1140
|
async archiveLocalParentSession(sessionResource) {
|
|
1078
|
-
if (sessionResource.scheme !== Schemas.vscodeLocalChatSession) {
|
|
1141
|
+
if (sessionResource.scheme !== Schemas.vscodeLocalChatSession && !IsSessionsWindowContext.getValue(this.contextKeyService)) {
|
|
1079
1142
|
return;
|
|
1080
1143
|
}
|
|
1144
|
+
this.logService.debug(
|
|
1145
|
+
`[Delegation] archiveLocalParentSession: archiving session ${( sessionResource.toString())}`
|
|
1146
|
+
);
|
|
1081
1147
|
await this.chatService.getSession(sessionResource)?.editingSession?.accept();
|
|
1082
1148
|
const session = this.agentSessionsService.getSession(sessionResource);
|
|
1083
|
-
session
|
|
1149
|
+
if (session) {
|
|
1150
|
+
session.setArchived(true);
|
|
1151
|
+
this.logService.debug("[Delegation] archiveLocalParentSession: session archived successfully");
|
|
1152
|
+
} else {
|
|
1153
|
+
this.logService.warn(
|
|
1154
|
+
`[Delegation] archiveLocalParentSession: session not found in agentSessionsService for ${( sessionResource.toString())}`
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1084
1157
|
}
|
|
1085
1158
|
setVisible(visible) {
|
|
1086
1159
|
const wasVisible = this._visible;
|
|
@@ -1178,13 +1251,14 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1178
1251
|
const currentContext = [];
|
|
1179
1252
|
const addedContextIds = ( new Set());
|
|
1180
1253
|
const addToContext = entry => {
|
|
1181
|
-
|
|
1254
|
+
const dedupKey = entry.range ? `${entry.id}:${entry.range.start}-${entry.range.endExclusive}` : entry.id;
|
|
1255
|
+
if (( addedContextIds.has(dedupKey)) || isWorkspaceVariableEntry(entry)) {
|
|
1182
1256
|
return;
|
|
1183
1257
|
}
|
|
1184
1258
|
if ((isPromptFileVariableEntry(entry) || isPromptTextVariableEntry(entry)) && entry.automaticallyAdded) {
|
|
1185
1259
|
return;
|
|
1186
1260
|
}
|
|
1187
|
-
addedContextIds.add(
|
|
1261
|
+
addedContextIds.add(dedupKey);
|
|
1188
1262
|
currentContext.push(entry);
|
|
1189
1263
|
};
|
|
1190
1264
|
for (let i = requests.length - 1; i >= 0; i -= 1) {
|
|
@@ -1208,7 +1282,11 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1208
1282
|
rowContainer.appendChild(this.inputContainer);
|
|
1209
1283
|
this.createInput(this.inputContainer);
|
|
1210
1284
|
this.input.setChatMode(this.inputPart.currentModeObs.get().id);
|
|
1285
|
+
this.input.setPermissionLevel(
|
|
1286
|
+
this.inputPart.currentModeInfo.permissionLevel ?? ChatPermissionLevel.Default
|
|
1287
|
+
);
|
|
1211
1288
|
this.input.setEditing(true, isEditingSentRequest);
|
|
1289
|
+
this._onDidChangeActiveInputEditor.fire();
|
|
1212
1290
|
} else {
|
|
1213
1291
|
this.inputPart.element.classList.add("editing");
|
|
1214
1292
|
}
|
|
@@ -1219,6 +1297,34 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1219
1297
|
this.inputPart.dnd.setDisabledOverlay(!isInput);
|
|
1220
1298
|
this.input.renderAttachedContext();
|
|
1221
1299
|
this.input.setValue(currentElement.messageText, false);
|
|
1300
|
+
const dynamicVariableModel = this.getContrib(ChatDynamicVariableModel.ID);
|
|
1301
|
+
const editorModel = this.input.inputEditor.getModel();
|
|
1302
|
+
if (dynamicVariableModel && editorModel) {
|
|
1303
|
+
const modelTextLength = editorModel.getValueLength();
|
|
1304
|
+
for (const entry of currentContext) {
|
|
1305
|
+
if (entry.range) {
|
|
1306
|
+
if (entry.range.start >= entry.range.endExclusive) {
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
if (entry.range.start < 0 || entry.range.endExclusive > modelTextLength) {
|
|
1310
|
+
continue;
|
|
1311
|
+
}
|
|
1312
|
+
const startPos = editorModel.getPositionAt(entry.range.start);
|
|
1313
|
+
const endPos = editorModel.getPositionAt(entry.range.endExclusive);
|
|
1314
|
+
dynamicVariableModel.addReference({
|
|
1315
|
+
id: entry.id,
|
|
1316
|
+
range: ( new Range(startPos.lineNumber, startPos.column, endPos.lineNumber, endPos.column)),
|
|
1317
|
+
data: entry.value,
|
|
1318
|
+
fullName: entry.fullName,
|
|
1319
|
+
icon: entry.icon,
|
|
1320
|
+
modelDescription: entry.modelDescription,
|
|
1321
|
+
isFile: entry.kind === "file",
|
|
1322
|
+
isDirectory: entry.kind === "directory"
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
this.listWidget.suppressAutoScroll = true;
|
|
1222
1328
|
this.onDidChangeItems();
|
|
1223
1329
|
this.input.inputEditor.focus();
|
|
1224
1330
|
this._register(this.inputPart.onDidClickOverlay(() => {
|
|
@@ -1240,6 +1346,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1240
1346
|
});
|
|
1241
1347
|
}
|
|
1242
1348
|
finishedEditing(completedEdit) {
|
|
1349
|
+
this.listWidget.suppressAutoScroll = false;
|
|
1243
1350
|
const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
|
|
1244
1351
|
if (this.recentlyRestoredCheckpoint) {
|
|
1245
1352
|
this.recentlyRestoredCheckpoint = false;
|
|
@@ -1253,6 +1360,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1253
1360
|
const isInput = this.configurationService.getValue("chat.editRequests") === "input";
|
|
1254
1361
|
if (!isInput) {
|
|
1255
1362
|
this.inputPart.setChatMode(this.input.currentModeObs.get().id);
|
|
1363
|
+
this.inputPart.setPermissionLevel(this.input.currentModeInfo.permissionLevel ?? ChatPermissionLevel.Default);
|
|
1256
1364
|
const currentModel = this.input.selectedLanguageModel.get();
|
|
1257
1365
|
if (currentModel) {
|
|
1258
1366
|
this.inputPart.switchModel(currentModel.metadata);
|
|
@@ -1275,6 +1383,9 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1275
1383
|
}
|
|
1276
1384
|
this.viewModel?.setEditing(undefined);
|
|
1277
1385
|
this.inputPart?.setEditing(false, undefined);
|
|
1386
|
+
if (!isInput) {
|
|
1387
|
+
this._onDidChangeActiveInputEditor.fire();
|
|
1388
|
+
}
|
|
1278
1389
|
this.onDidChangeItems();
|
|
1279
1390
|
this.telemetryService.publicLog2("chat.editRequestsFinished", {
|
|
1280
1391
|
editRequestType: this.configurationService.getValue("chat.editRequests"),
|
|
@@ -1306,11 +1417,12 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1306
1417
|
renderWorkingSet: this.viewOptions.enableWorkingSet === "explicit",
|
|
1307
1418
|
supportsChangingModes: this.viewOptions.supportsChangingModes,
|
|
1308
1419
|
dndContainer: this.viewOptions.dndContainer,
|
|
1420
|
+
inputEditorMinLines: this.viewOptions.inputEditorMinLines,
|
|
1309
1421
|
widgetViewKindTag: this.getWidgetViewKindTag(),
|
|
1310
1422
|
defaultMode: this.viewOptions.defaultMode,
|
|
1311
1423
|
sessionTypePickerDelegate: this.viewOptions.sessionTypePickerDelegate,
|
|
1312
1424
|
workspacePickerDelegate: this.viewOptions.workspacePickerDelegate,
|
|
1313
|
-
|
|
1425
|
+
isSessionsWindow: this.viewOptions.isSessionsWindow
|
|
1314
1426
|
};
|
|
1315
1427
|
if (this.viewModel?.editing) {
|
|
1316
1428
|
const editedRequest = this.listWidget.getTemplateDataForRequestId(this.viewModel?.editing?.id);
|
|
@@ -1386,6 +1498,28 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1386
1498
|
this.renderFollowups();
|
|
1387
1499
|
this.renderChatSuggestNextWidget();
|
|
1388
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
|
+
}));
|
|
1507
|
+
let previousModelIdentifier;
|
|
1508
|
+
this._register(autorun(reader => {
|
|
1509
|
+
const modelIdentifier = this.inputPart.selectedLanguageModel.read(reader)?.identifier;
|
|
1510
|
+
if (previousModelIdentifier === undefined) {
|
|
1511
|
+
previousModelIdentifier = modelIdentifier;
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1514
|
+
if (previousModelIdentifier === modelIdentifier) {
|
|
1515
|
+
return;
|
|
1516
|
+
}
|
|
1517
|
+
previousModelIdentifier = modelIdentifier;
|
|
1518
|
+
if (!this._gettingStartedTipPartRef) {
|
|
1519
|
+
return;
|
|
1520
|
+
}
|
|
1521
|
+
this.chatTipService.getWelcomeTip(this.contextKeyService);
|
|
1522
|
+
}));
|
|
1389
1523
|
this._register(autorun(r => {
|
|
1390
1524
|
const toolSetIds = ( new Set());
|
|
1391
1525
|
const toolIds = ( new Set());
|
|
@@ -1438,15 +1572,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1438
1572
|
}
|
|
1439
1573
|
this.inputPart.clearTodoListWidget(model.sessionResource, false);
|
|
1440
1574
|
this.chatSuggestNextWidget.hide();
|
|
1575
|
+
this.chatTipService.resetSession();
|
|
1576
|
+
this._gettingStartedTipPartRef = undefined;
|
|
1577
|
+
this._gettingStartedTipPart.clear();
|
|
1578
|
+
const tipContainer = this.inputPart.gettingStartedTipContainerElement;
|
|
1579
|
+
clearNode(tipContainer);
|
|
1580
|
+
setVisibility(false, tipContainer);
|
|
1441
1581
|
this._codeBlockModelCollection.clear();
|
|
1442
|
-
this.container.setAttribute("data-session-id", model.sessionId);
|
|
1443
|
-
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1444
1582
|
this.inputPart.setInputModel(model.inputModel, model.getRequests().length === 0);
|
|
1583
|
+
this.viewModel = this.instantiationService.createInstance(ChatViewModel, model, this._codeBlockModelCollection, undefined);
|
|
1445
1584
|
this.listWidget.setViewModel(this.viewModel);
|
|
1446
1585
|
if (this._lockedAgent) {
|
|
1447
1586
|
let placeholder = this.chatSessionsService.getInputPlaceholderForSessionType(this._lockedAgent.id);
|
|
1448
1587
|
if (!placeholder) {
|
|
1449
|
-
placeholder = ( localize(
|
|
1588
|
+
placeholder = ( localize(6769, "Chat with {0}", this._lockedAgent.id));
|
|
1450
1589
|
}
|
|
1451
1590
|
this.viewModel.setInputPlaceholder(placeholder);
|
|
1452
1591
|
this.inputEditor.updateOptions({
|
|
@@ -1484,12 +1623,20 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1484
1623
|
this.onDidChangeItems();
|
|
1485
1624
|
}));
|
|
1486
1625
|
this._sessionIsEmptyContextKey.set(model.getRequests().length === 0);
|
|
1487
|
-
|
|
1488
|
-
|
|
1626
|
+
this._sessionHasDebugDataContextKey.set(this.chatDebugService.getEvents(model.sessionResource).length > 0);
|
|
1627
|
+
let lastSteeringCount = 0;
|
|
1628
|
+
const updatePendingRequestKeys = announceSteering => {
|
|
1629
|
+
const pendingRequests = model.getPendingRequests();
|
|
1630
|
+
const pendingCount = pendingRequests.length;
|
|
1489
1631
|
this._hasPendingRequestsContextKey.set(pendingCount > 0);
|
|
1632
|
+
const steeringCount = pendingRequests.filter(pending => pending.kind === ChatRequestQueueKind.Steering).length;
|
|
1633
|
+
if (announceSteering && steeringCount > 0 && lastSteeringCount === 0) {
|
|
1634
|
+
status(( localize(6770, "Steering")));
|
|
1635
|
+
}
|
|
1636
|
+
lastSteeringCount = steeringCount;
|
|
1490
1637
|
};
|
|
1491
|
-
updatePendingRequestKeys();
|
|
1492
|
-
this.viewModelDisposables.add(model.onDidChangePendingRequests(() => updatePendingRequestKeys()));
|
|
1638
|
+
updatePendingRequestKeys(false);
|
|
1639
|
+
this.viewModelDisposables.add(model.onDidChangePendingRequests(() => updatePendingRequestKeys(true)));
|
|
1493
1640
|
this.refreshParsedInput();
|
|
1494
1641
|
this.viewModelDisposables.add(model.onDidChange(e => {
|
|
1495
1642
|
if (e.kind === "setAgent") {
|
|
@@ -1623,7 +1770,8 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1623
1770
|
const options = {
|
|
1624
1771
|
attempt: lastRequest.attempt + 1,
|
|
1625
1772
|
location: this.location,
|
|
1626
|
-
userSelectedModelId: this.input.currentLanguageModel
|
|
1773
|
+
userSelectedModelId: this.input.currentLanguageModel,
|
|
1774
|
+
modeInfo: this.input.currentModeInfo
|
|
1627
1775
|
};
|
|
1628
1776
|
return await this.chatService.resendRequest(lastRequest, options);
|
|
1629
1777
|
}
|
|
@@ -1632,6 +1780,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1632
1780
|
if (!agentSlashPromptPart) {
|
|
1633
1781
|
return;
|
|
1634
1782
|
}
|
|
1783
|
+
this.chatTipService.recordSlashCommandUsage(agentSlashPromptPart.name);
|
|
1635
1784
|
const slashCommand = await this.promptsService.resolvePromptSlashCommand(agentSlashPromptPart.name, CancellationToken.None);
|
|
1636
1785
|
if (!slashCommand) {
|
|
1637
1786
|
return;
|
|
@@ -1655,6 +1804,17 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1655
1804
|
toolReferences
|
|
1656
1805
|
));
|
|
1657
1806
|
requestInput.input = ( this.parsedInput.parts.filter(part => !(part instanceof ChatRequestSlashPromptPart)).map(part => part.text)).join("").trim();
|
|
1807
|
+
const promptPath = slashCommand.promptPath;
|
|
1808
|
+
const promptRunEvent = {
|
|
1809
|
+
storage: promptPath.storage
|
|
1810
|
+
};
|
|
1811
|
+
if (promptPath.storage === PromptsStorage.extension) {
|
|
1812
|
+
promptRunEvent.extensionId = promptPath.extension.identifier.value;
|
|
1813
|
+
promptRunEvent.promptName = slashCommand.name;
|
|
1814
|
+
} else {
|
|
1815
|
+
promptRunEvent.promptNameHash = ( hash(slashCommand.name).toString(16));
|
|
1816
|
+
}
|
|
1817
|
+
this.telemetryService.publicLog2("chat.promptRun", promptRunEvent);
|
|
1658
1818
|
const input = requestInput.input.trim();
|
|
1659
1819
|
requestInput.input = `Follow instructions in [${basename(parseResult.uri)}](${( parseResult.uri.toString())}).`;
|
|
1660
1820
|
if (input) {
|
|
@@ -1693,7 +1853,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1693
1853
|
const editorValue = this.getInput();
|
|
1694
1854
|
const requestInputs = {
|
|
1695
1855
|
input: !query ? editorValue : query.query,
|
|
1696
|
-
attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext(
|
|
1856
|
+
attachedContext: options?.enableImplicitContext === false ? this.input.getAttachedContext() : this.input.getAttachedAndImplicitContext()
|
|
1697
1857
|
};
|
|
1698
1858
|
const isUserQuery = !query;
|
|
1699
1859
|
const isEditing = this.viewModel?.editing;
|
|
@@ -1704,7 +1864,7 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1704
1864
|
this.chatService.removePendingRequest(this.viewModel.sessionResource, editingRequestId);
|
|
1705
1865
|
options.queue ??= editingPendingRequest;
|
|
1706
1866
|
} else {
|
|
1707
|
-
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource);
|
|
1867
|
+
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-editing");
|
|
1708
1868
|
options.queue = undefined;
|
|
1709
1869
|
}
|
|
1710
1870
|
this.finishedEditing(true);
|
|
@@ -1712,15 +1872,22 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1712
1872
|
}
|
|
1713
1873
|
const model = this.viewModel.model;
|
|
1714
1874
|
const requestInProgress = model.requestInProgress.get();
|
|
1875
|
+
if (options.alwaysQueue) {
|
|
1876
|
+
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1877
|
+
}
|
|
1878
|
+
if (model.requestNeedsInput.get() && !model.getPendingRequests().length) {
|
|
1879
|
+
this.chatService.cancelCurrentRequestForSession(this.viewModel.sessionResource, "acceptInput-needsInput");
|
|
1880
|
+
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1881
|
+
}
|
|
1715
1882
|
if (requestInProgress) {
|
|
1716
1883
|
options.queue ??= ChatRequestQueueKind.Queued;
|
|
1717
1884
|
}
|
|
1718
|
-
if (!requestInProgress && !isEditing && !(await this.confirmPendingRequestsBeforeSend(model, options))) {
|
|
1885
|
+
if (!options.alwaysQueue && !requestInProgress && !isEditing && !(await this.confirmPendingRequestsBeforeSend(model, options))) {
|
|
1719
1886
|
return;
|
|
1720
1887
|
}
|
|
1721
1888
|
await this._applyPromptFileIfSet(requestInputs);
|
|
1722
1889
|
await this._autoAttachInstructions(requestInputs);
|
|
1723
|
-
if (this.viewOptions.enableWorkingSet !== undefined && this.input.currentModeKind === ChatModeKind.Edit
|
|
1890
|
+
if (this.viewOptions.enableWorkingSet !== undefined && this.input.currentModeKind === ChatModeKind.Edit) {
|
|
1724
1891
|
const uniqueWorkingSetEntries = ( new ResourceSet());
|
|
1725
1892
|
const editingSessionAttachedContext = requestInputs.attachedContext;
|
|
1726
1893
|
const previousRequests = this.viewModel.model.getRequests();
|
|
@@ -1751,27 +1918,26 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1751
1918
|
}
|
|
1752
1919
|
}
|
|
1753
1920
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
}
|
|
1921
|
+
const resolvedImageVariables = await this._resolveDirectoryImageAttachments(requestInputs.attachedContext.asArray());
|
|
1922
|
+
const submittedSessionResource = this.viewModel.sessionResource;
|
|
1757
1923
|
const result = await this.chatService.sendRequest(this.viewModel.sessionResource, requestInputs.input, {
|
|
1758
1924
|
userSelectedModelId: this.input.currentLanguageModel,
|
|
1759
1925
|
location: this.location,
|
|
1760
1926
|
locationData: this._location.resolveData?.(),
|
|
1761
1927
|
parserContext: {
|
|
1762
1928
|
selectedAgent: this._lastSelectedAgent,
|
|
1763
|
-
mode: this.input.currentModeKind
|
|
1929
|
+
mode: this.input.currentModeKind,
|
|
1930
|
+
attachmentCapabilities: this._lastSelectedAgent?.capabilities ?? this.attachmentCapabilities
|
|
1764
1931
|
},
|
|
1765
1932
|
attachedContext: requestInputs.attachedContext.asArray(),
|
|
1933
|
+
resolvedVariables: resolvedImageVariables,
|
|
1766
1934
|
noCommandDetection: options?.noCommandDetection,
|
|
1767
1935
|
...this.getModeRequestOptions(),
|
|
1768
1936
|
modeInfo: this.input.currentModeInfo,
|
|
1769
1937
|
agentIdSilent: this._lockedAgent?.id,
|
|
1770
|
-
queue: options?.queue
|
|
1938
|
+
queue: options?.queue,
|
|
1939
|
+
pauseQueue: options?.alwaysQueue
|
|
1771
1940
|
});
|
|
1772
|
-
if (this.viewModel.sessionResource && !options.queue) {
|
|
1773
|
-
this.chatAccessibilityService.disposeRequest(this.viewModel.sessionResource);
|
|
1774
|
-
}
|
|
1775
1941
|
if (ChatSendResult.isRejected(result)) {
|
|
1776
1942
|
return;
|
|
1777
1943
|
}
|
|
@@ -1786,30 +1952,46 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1786
1952
|
slashCommand: sent.data.slashCommand
|
|
1787
1953
|
});
|
|
1788
1954
|
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.
|
|
1955
|
+
sent.data.responseCreatedPromise.then(() => {
|
|
1956
|
+
this.chatAccessibilityService.acceptRequest(submittedSessionResource);
|
|
1957
|
+
sent.data.responseCompletePromise.then(() => {
|
|
1958
|
+
const responses = this.viewModel?.getItems().filter(isResponseVM);
|
|
1959
|
+
const lastResponse = responses?.[responses.length - 1];
|
|
1960
|
+
this.chatAccessibilityService.acceptResponse(
|
|
1961
|
+
this,
|
|
1962
|
+
this.container,
|
|
1963
|
+
lastResponse,
|
|
1964
|
+
submittedSessionResource,
|
|
1965
|
+
options?.isVoiceInput
|
|
1966
|
+
);
|
|
1967
|
+
if (lastResponse?.result?.nextQuestion) {
|
|
1968
|
+
const {
|
|
1969
|
+
prompt,
|
|
1970
|
+
participant,
|
|
1971
|
+
command
|
|
1972
|
+
} = lastResponse.result.nextQuestion;
|
|
1973
|
+
const question = formatChatQuestion(this.chatAgentService, this.location, prompt, participant, command);
|
|
1974
|
+
if (question) {
|
|
1975
|
+
this.input.setValue(question, false);
|
|
1976
|
+
}
|
|
1808
1977
|
}
|
|
1809
|
-
}
|
|
1978
|
+
});
|
|
1810
1979
|
});
|
|
1811
1980
|
return sent.data.responseCreatedPromise;
|
|
1812
1981
|
}
|
|
1982
|
+
async _resolveDirectoryImageAttachments(attachments) {
|
|
1983
|
+
const imagePromises = [];
|
|
1984
|
+
for (const attachment of attachments) {
|
|
1985
|
+
if (attachment.kind === "directory" && URI.isUri(attachment.value)) {
|
|
1986
|
+
imagePromises.push(this.chatAttachmentResolveService.resolveDirectoryImages(attachment.value));
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
if (imagePromises.length === 0) {
|
|
1990
|
+
return [];
|
|
1991
|
+
}
|
|
1992
|
+
const resolved = await Promise.all(imagePromises);
|
|
1993
|
+
return resolved.flat();
|
|
1994
|
+
}
|
|
1813
1995
|
async confirmPendingRequestsBeforeSend(model, options) {
|
|
1814
1996
|
if (options.queue) {
|
|
1815
1997
|
return true;
|
|
@@ -1820,16 +2002,16 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1820
2002
|
}
|
|
1821
2003
|
const promptResult = await this.dialogService.prompt({
|
|
1822
2004
|
type: "question",
|
|
1823
|
-
message: ( localize(
|
|
2005
|
+
message: ( localize(6771, "You already have pending requests.")),
|
|
1824
2006
|
detail: ( localize(
|
|
1825
|
-
|
|
2007
|
+
6772,
|
|
1826
2008
|
"Do you want to keep them in the queue or remove them before sending this message?"
|
|
1827
2009
|
)),
|
|
1828
2010
|
buttons: [{
|
|
1829
|
-
label: ( localize(
|
|
2011
|
+
label: ( localize(6773, "Keep Pending Requests")),
|
|
1830
2012
|
run: () => "keep"
|
|
1831
2013
|
}, {
|
|
1832
|
-
label: ( localize(
|
|
2014
|
+
label: ( localize(6774, "Remove Pending Requests")),
|
|
1833
2015
|
run: () => "remove"
|
|
1834
2016
|
}],
|
|
1835
2017
|
cancelButton: true
|
|
@@ -1845,9 +2027,21 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
1845
2027
|
return true;
|
|
1846
2028
|
}
|
|
1847
2029
|
getModeRequestOptions() {
|
|
2030
|
+
const sessionResource = this.viewModel?.sessionResource;
|
|
2031
|
+
const userSelectedTools = this.input.selectedToolsModel.userSelectedTools;
|
|
2032
|
+
let lastToolsSnapshot = userSelectedTools.get();
|
|
2033
|
+
const scopedTools = derived(reader => {
|
|
2034
|
+
const activeSession = this._viewModelObs.read(reader)?.sessionResource;
|
|
2035
|
+
if (isEqual(activeSession, sessionResource)) {
|
|
2036
|
+
const tools = userSelectedTools.read(reader);
|
|
2037
|
+
lastToolsSnapshot = tools;
|
|
2038
|
+
return tools;
|
|
2039
|
+
}
|
|
2040
|
+
return lastToolsSnapshot;
|
|
2041
|
+
});
|
|
1848
2042
|
return {
|
|
1849
2043
|
modeInfo: this.input.currentModeInfo,
|
|
1850
|
-
userSelectedTools:
|
|
2044
|
+
userSelectedTools: scopedTools
|
|
1851
2045
|
};
|
|
1852
2046
|
}
|
|
1853
2047
|
getCodeBlockInfosForResponse(response) {
|
|
@@ -2035,11 +2229,13 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2035
2229
|
this.logService.debug(`ChatWidget#_autoAttachInstructions: prompt files are always enabled`);
|
|
2036
2230
|
const enabledTools = this.input.currentModeKind === ChatModeKind.Agent ? this.input.selectedToolsModel.userSelectedTools.get() : undefined;
|
|
2037
2231
|
const enabledSubAgents = this.input.currentModeKind === ChatModeKind.Agent ? this.input.currentModeObs.get().agents?.get() : undefined;
|
|
2232
|
+
const sessionResource = this._viewModel?.model.sessionResource;
|
|
2038
2233
|
const computer = this.instantiationService.createInstance(
|
|
2039
2234
|
ComputeAutomaticInstructions,
|
|
2040
2235
|
this.input.currentModeKind,
|
|
2041
2236
|
enabledTools,
|
|
2042
|
-
enabledSubAgents
|
|
2237
|
+
enabledSubAgents,
|
|
2238
|
+
sessionResource
|
|
2043
2239
|
);
|
|
2044
2240
|
await computer.collect(attachedContext, CancellationToken.None);
|
|
2045
2241
|
}
|
|
@@ -2047,6 +2243,6 @@ let ChatWidget = class ChatWidget extends Disposable {
|
|
|
2047
2243
|
this.listWidget.delegateScrollFromMouseWheelEvent(browserEvent);
|
|
2048
2244
|
}
|
|
2049
2245
|
};
|
|
2050
|
-
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));
|
|
2051
2247
|
|
|
2052
2248
|
export { ChatWidget, isQuickChat };
|