@codingame/monaco-vscode-katex-common 24.1.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/empty.js +1 -0
- package/package.json +45 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +37 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +127 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +27 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +81 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +44 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +172 -0
- package/vscode/src/vs/platform/editor/browser/editor.d.ts +12 -0
- package/vscode/src/vs/platform/editor/browser/editor.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +295 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +650 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +364 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.d.ts +169 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.js +951 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.js +286 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.d.ts +116 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +417 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.js +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.js +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.d.ts +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +567 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.js +259 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +528 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.js +429 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.js +164 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css +341 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatExtensionsContent.css +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMarkdownPart.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMcpServersInteractionContent.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatPullRequestContent.css +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatThinkingContent.css +162 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +96 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.js +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +353 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +100 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +1085 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +275 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +225 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +388 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +721 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +409 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.d.ts +334 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +2008 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.d.ts +217 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1573 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +249 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.js +174 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionAction.css +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.d.ts +292 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +2014 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.d.ts +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +797 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.js +345 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1069 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css +2880 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatCodeBlockPill.css +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css +209 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.js +135 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +176 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +373 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +171 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +1442 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +199 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +482 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +37 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +95 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +497 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +76 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +464 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +124 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +562 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +279 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +411 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +66 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +154 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +201 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +372 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +594 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1746 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +269 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +806 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +116 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +295 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +241 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +146 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +42 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +77 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +823 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +567 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +189 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +439 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +263 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +89 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +108 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +145 -0
|
@@ -0,0 +1,650 @@
|
|
|
1
|
+
|
|
2
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
|
+
import { KeyCode, KeyMod } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
4
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
6
|
+
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
+
import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
|
|
8
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
9
|
+
import { Action2, MenuId, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
10
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
11
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
12
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
13
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
14
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
|
+
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
16
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
18
|
+
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
19
|
+
import { chatVariableLeader } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
20
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
21
|
+
import { ChatModeKind, ChatAgentLocation, ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
22
|
+
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
23
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
24
|
+
import { getEditingSessionContext } from '../chatEditing/chatEditingActions.js';
|
|
25
|
+
import { ctxHasEditorModification } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys';
|
|
26
|
+
import { CHAT_CATEGORY, handleModeSwitch, ACTION_ID_NEW_CHAT, handleCurrentEditingSession } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
27
|
+
import { ContinueChatInSessionAction } from './chatContinueInAction.js';
|
|
28
|
+
|
|
29
|
+
class SubmitAction extends Action2 {
|
|
30
|
+
async run(accessor, ...args) {
|
|
31
|
+
const context = args[0];
|
|
32
|
+
const telemetryService = accessor.get(ITelemetryService);
|
|
33
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
34
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
35
|
+
if (widget?.viewModel?.editing) {
|
|
36
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
37
|
+
const dialogService = accessor.get(IDialogService);
|
|
38
|
+
const chatService = accessor.get(IChatService);
|
|
39
|
+
const chatModel = chatService.getSession(widget.viewModel.sessionResource);
|
|
40
|
+
if (!chatModel) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const session = chatModel.editingSession;
|
|
44
|
+
if (!session) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const requestId = widget.viewModel?.editing.id;
|
|
48
|
+
if (requestId) {
|
|
49
|
+
const chatRequests = chatModel.getRequests();
|
|
50
|
+
const itemIndex = chatRequests.findIndex(request => request.id === requestId);
|
|
51
|
+
const editsToUndo = chatRequests.length - itemIndex;
|
|
52
|
+
const requestsToRemove = chatRequests.slice(itemIndex);
|
|
53
|
+
const requestIdsToRemove = ( new Set(( requestsToRemove.map(request => request.id))));
|
|
54
|
+
const entriesModifiedInRequestsToRemove = session.entries.get().filter((entry) => ( requestIdsToRemove.has(entry.lastModifyingRequestId))) ?? [];
|
|
55
|
+
const shouldPrompt = entriesModifiedInRequestsToRemove.length > 0 && configurationService.getValue('chat.editing.confirmEditRequestRemoval') === true;
|
|
56
|
+
let message;
|
|
57
|
+
if (editsToUndo === 1) {
|
|
58
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
59
|
+
message = ( localize(
|
|
60
|
+
4709,
|
|
61
|
+
"This will remove your last request and undo the edits made to {0}. Do you want to proceed?",
|
|
62
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
message = ( localize(
|
|
67
|
+
4710,
|
|
68
|
+
"This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
69
|
+
entriesModifiedInRequestsToRemove.length
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
75
|
+
message = ( localize(
|
|
76
|
+
4711,
|
|
77
|
+
"This will remove all subsequent requests and undo edits made to {0}. Do you want to proceed?",
|
|
78
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
79
|
+
));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
message = ( localize(
|
|
83
|
+
4712,
|
|
84
|
+
"This will remove all subsequent requests and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
85
|
+
entriesModifiedInRequestsToRemove.length
|
|
86
|
+
));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const confirmation = shouldPrompt
|
|
90
|
+
? await dialogService.confirm({
|
|
91
|
+
title: editsToUndo === 1
|
|
92
|
+
? ( localize(4713, "Do you want to undo your last edit?"))
|
|
93
|
+
: ( localize(4714, "Do you want to undo {0} edits?", editsToUndo)),
|
|
94
|
+
message: message,
|
|
95
|
+
primaryButton: ( localize(4715, "Yes")),
|
|
96
|
+
checkbox: { label: ( localize(4716, "Don't ask again")), checked: false },
|
|
97
|
+
type: 'info'
|
|
98
|
+
})
|
|
99
|
+
: { confirmed: true };
|
|
100
|
+
if (!confirmation.confirmed) {
|
|
101
|
+
telemetryService.publicLog2('chat.undoEditsConfirmation', {
|
|
102
|
+
editRequestType: configurationService.getValue('chat.editRequests'),
|
|
103
|
+
outcome: 'cancelled',
|
|
104
|
+
editsUndoCount: editsToUndo
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
else if (editsToUndo > 0) {
|
|
109
|
+
telemetryService.publicLog2('chat.undoEditsConfirmation', {
|
|
110
|
+
editRequestType: configurationService.getValue('chat.editRequests'),
|
|
111
|
+
outcome: 'applied',
|
|
112
|
+
editsUndoCount: editsToUndo
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
if (confirmation.checkboxChecked) {
|
|
116
|
+
await configurationService.updateValue('chat.editing.confirmEditRequestRemoval', false);
|
|
117
|
+
}
|
|
118
|
+
const snapshotRequestId = chatRequests[itemIndex].id;
|
|
119
|
+
await session.restoreSnapshot(snapshotRequestId, undefined);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else if (widget?.viewModel?.model.checkpoint) {
|
|
123
|
+
widget.viewModel.model.setCheckpoint(undefined);
|
|
124
|
+
}
|
|
125
|
+
widget?.acceptInput(context?.inputValue);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const whenNotInProgress = ( ChatContextKeys.requestInProgress.negate());
|
|
129
|
+
class ChatSubmitAction extends SubmitAction {
|
|
130
|
+
static { this.ID = 'workbench.action.chat.submit'; }
|
|
131
|
+
constructor() {
|
|
132
|
+
const menuCondition = ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Ask));
|
|
133
|
+
const precondition = ( ContextKeyExpr.and(ChatContextKeys.inputHasText, whenNotInProgress));
|
|
134
|
+
super({
|
|
135
|
+
id: ChatSubmitAction.ID,
|
|
136
|
+
title: ( localize2(4717, "Send")),
|
|
137
|
+
f1: false,
|
|
138
|
+
category: CHAT_CATEGORY,
|
|
139
|
+
icon: Codicon.send,
|
|
140
|
+
precondition,
|
|
141
|
+
toggled: {
|
|
142
|
+
condition: ChatContextKeys.lockedToCodingAgent,
|
|
143
|
+
icon: Codicon.send,
|
|
144
|
+
tooltip: ( localize(4718, "Send to Agent")),
|
|
145
|
+
},
|
|
146
|
+
keybinding: {
|
|
147
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatInput, ( ChatContextKeys.withinEditSessionDiff.negate()))),
|
|
148
|
+
primary: KeyCode.Enter,
|
|
149
|
+
weight: KeybindingWeight.EditorContrib
|
|
150
|
+
},
|
|
151
|
+
menu: [
|
|
152
|
+
{
|
|
153
|
+
id: MenuId.ChatExecute,
|
|
154
|
+
order: 4,
|
|
155
|
+
when: ( ContextKeyExpr.and(whenNotInProgress, menuCondition, ( ChatContextKeys.withinEditSessionDiff.negate()))),
|
|
156
|
+
group: 'navigation',
|
|
157
|
+
alt: {
|
|
158
|
+
id: 'workbench.action.chat.sendToNewChat',
|
|
159
|
+
title: ( localize2(4719, "Send to New Chat")),
|
|
160
|
+
icon: Codicon.plus
|
|
161
|
+
}
|
|
162
|
+
}, {
|
|
163
|
+
id: MenuId.ChatEditorInlineExecute,
|
|
164
|
+
group: 'navigation',
|
|
165
|
+
order: 4,
|
|
166
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( ctxHasEditorModification.negate()), ChatContextKeys.inputHasText)), whenNotInProgress, ( ChatContextKeys.requestInProgress.negate()), menuCondition)),
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
class ChatDelegateToEditSessionAction extends Action2 {
|
|
173
|
+
static { this.ID = 'workbench.action.chat.delegateToEditSession'; }
|
|
174
|
+
constructor() {
|
|
175
|
+
super({
|
|
176
|
+
id: ChatDelegateToEditSessionAction.ID,
|
|
177
|
+
title: ( localize2(4720, "Send to Edit Session")),
|
|
178
|
+
f1: false,
|
|
179
|
+
category: CHAT_CATEGORY,
|
|
180
|
+
icon: Codicon.commentDiscussion,
|
|
181
|
+
keybinding: {
|
|
182
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatInput, ChatContextKeys.withinEditSessionDiff)),
|
|
183
|
+
primary: KeyCode.Enter,
|
|
184
|
+
weight: KeybindingWeight.EditorContrib
|
|
185
|
+
},
|
|
186
|
+
menu: [
|
|
187
|
+
{
|
|
188
|
+
id: MenuId.ChatExecute,
|
|
189
|
+
order: 4,
|
|
190
|
+
when: ( ContextKeyExpr.and(whenNotInProgress, ChatContextKeys.withinEditSessionDiff)),
|
|
191
|
+
group: 'navigation',
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
async run(accessor, ...args) {
|
|
197
|
+
const context = args[0];
|
|
198
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
199
|
+
const inlineWidget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
200
|
+
const locationData = inlineWidget?.locationData;
|
|
201
|
+
if (inlineWidget && locationData?.type === ChatAgentLocation.EditorInline && locationData.delegateSessionResource) {
|
|
202
|
+
const sessionWidget = widgetService.getWidgetBySessionResource(locationData.delegateSessionResource);
|
|
203
|
+
if (sessionWidget) {
|
|
204
|
+
await widgetService.reveal(sessionWidget);
|
|
205
|
+
sessionWidget.attachmentModel.addContext({
|
|
206
|
+
id: 'vscode.delegate.inline',
|
|
207
|
+
kind: 'file',
|
|
208
|
+
modelDescription: `User's chat context`,
|
|
209
|
+
name: 'delegate-inline',
|
|
210
|
+
value: { range: locationData.wholeRange, uri: locationData.document },
|
|
211
|
+
});
|
|
212
|
+
sessionWidget.acceptInput(inlineWidget.getInput(), {
|
|
213
|
+
noCommandDetection: true,
|
|
214
|
+
enableImplicitContext: false,
|
|
215
|
+
});
|
|
216
|
+
inlineWidget.setInput('');
|
|
217
|
+
locationData.close();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const ToggleAgentModeActionId = 'workbench.action.chat.toggleAgentMode';
|
|
223
|
+
class ToggleChatModeAction extends Action2 {
|
|
224
|
+
static { this.ID = ToggleAgentModeActionId; }
|
|
225
|
+
constructor() {
|
|
226
|
+
super({
|
|
227
|
+
id: ToggleChatModeAction.ID,
|
|
228
|
+
title: ( localize2(4721, "Switch to Next Agent")),
|
|
229
|
+
f1: true,
|
|
230
|
+
category: CHAT_CATEGORY,
|
|
231
|
+
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ChatContextKeys.requestInProgress.negate())))
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
async run(accessor, ...args) {
|
|
235
|
+
const commandService = accessor.get(ICommandService);
|
|
236
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
237
|
+
const instaService = accessor.get(IInstantiationService);
|
|
238
|
+
const modeService = accessor.get(IChatModeService);
|
|
239
|
+
const telemetryService = accessor.get(ITelemetryService);
|
|
240
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
241
|
+
const arg = args.at(0);
|
|
242
|
+
let widget;
|
|
243
|
+
if (arg?.sessionResource) {
|
|
244
|
+
widget = chatWidgetService.getWidgetBySessionResource(arg.sessionResource);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
widget = getEditingSessionContext(accessor, args)?.chatWidget;
|
|
248
|
+
}
|
|
249
|
+
if (!widget) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const chatSession = widget.viewModel?.model;
|
|
253
|
+
const requestCount = chatSession?.getRequests().length ?? 0;
|
|
254
|
+
const switchToMode = (arg && modeService.findModeById(arg.modeId)) ?? this.getNextMode(widget, requestCount, configurationService, modeService);
|
|
255
|
+
const currentMode = widget.input.currentModeObs.get();
|
|
256
|
+
if (switchToMode.id === currentMode.id) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
const chatModeCheck = await instaService.invokeFunction(handleModeSwitch, widget.input.currentModeKind, switchToMode.kind, requestCount, widget.viewModel?.model);
|
|
260
|
+
if (!chatModeCheck) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const storage = switchToMode.source?.storage ?? 'builtin';
|
|
264
|
+
const extensionId = switchToMode.source?.storage === 'extension' ? switchToMode.source.extensionId.value : undefined;
|
|
265
|
+
const toolsCount = switchToMode.customTools?.get()?.length ?? 0;
|
|
266
|
+
const handoffsCount = switchToMode.handOffs?.get()?.length ?? 0;
|
|
267
|
+
telemetryService.publicLog2('chat.modeChange', {
|
|
268
|
+
fromMode: currentMode.name.get(),
|
|
269
|
+
mode: switchToMode.name.get(),
|
|
270
|
+
requestCount: requestCount,
|
|
271
|
+
storage,
|
|
272
|
+
extensionId,
|
|
273
|
+
toolsCount,
|
|
274
|
+
handoffsCount
|
|
275
|
+
});
|
|
276
|
+
widget.input.setChatMode(switchToMode.id);
|
|
277
|
+
if (chatModeCheck.needToClearSession) {
|
|
278
|
+
await commandService.executeCommand(ACTION_ID_NEW_CHAT);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
getNextMode(chatWidget, requestCount, configurationService, modeService) {
|
|
282
|
+
const modes = modeService.getModes();
|
|
283
|
+
const flat = [
|
|
284
|
+
...modes.builtin.filter(mode => {
|
|
285
|
+
return mode.kind !== ChatModeKind.Edit || configurationService.getValue(ChatConfiguration.Edits2Enabled) || requestCount === 0;
|
|
286
|
+
}),
|
|
287
|
+
...(modes.custom ?? []),
|
|
288
|
+
];
|
|
289
|
+
const curModeIndex = flat.findIndex(mode => mode.id === chatWidget.input.currentModeObs.get().id);
|
|
290
|
+
const newMode = flat[(curModeIndex + 1) % flat.length];
|
|
291
|
+
return newMode;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
class SwitchToNextModelAction extends Action2 {
|
|
295
|
+
static { this.ID = 'workbench.action.chat.switchToNextModel'; }
|
|
296
|
+
constructor() {
|
|
297
|
+
super({
|
|
298
|
+
id: SwitchToNextModelAction.ID,
|
|
299
|
+
title: ( localize2(4722, "Switch to Next Model")),
|
|
300
|
+
category: CHAT_CATEGORY,
|
|
301
|
+
f1: true,
|
|
302
|
+
precondition: ChatContextKeys.enabled,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
run(accessor, ...args) {
|
|
306
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
307
|
+
const widget = widgetService.lastFocusedWidget;
|
|
308
|
+
widget?.input.switchToNextModel();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
const ChatOpenModelPickerActionId = 'workbench.action.chat.openModelPicker';
|
|
312
|
+
class OpenModelPickerAction extends Action2 {
|
|
313
|
+
static { this.ID = ChatOpenModelPickerActionId; }
|
|
314
|
+
constructor() {
|
|
315
|
+
super({
|
|
316
|
+
id: OpenModelPickerAction.ID,
|
|
317
|
+
title: ( localize2(4723, "Open Model Picker")),
|
|
318
|
+
category: CHAT_CATEGORY,
|
|
319
|
+
f1: false,
|
|
320
|
+
keybinding: {
|
|
321
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Period,
|
|
322
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
323
|
+
when: ChatContextKeys.inChatInput
|
|
324
|
+
},
|
|
325
|
+
precondition: ChatContextKeys.enabled,
|
|
326
|
+
menu: {
|
|
327
|
+
id: MenuId.ChatInput,
|
|
328
|
+
order: 3,
|
|
329
|
+
group: 'navigation',
|
|
330
|
+
when: ( ContextKeyExpr.and(( ChatContextKeys.lockedToCodingAgent.negate()), ( ContextKeyExpr.or(( ContextKeyExpr.equals(ChatContextKeys.location.key, ChatAgentLocation.Chat)), ( ContextKeyExpr.equals(ChatContextKeys.location.key, ChatAgentLocation.EditorInline)), ( ContextKeyExpr.equals(ChatContextKeys.location.key, ChatAgentLocation.Notebook)), ( ContextKeyExpr.equals(ChatContextKeys.location.key, ChatAgentLocation.Terminal))))))
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
async run(accessor, ...args) {
|
|
335
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
336
|
+
const widget = widgetService.lastFocusedWidget;
|
|
337
|
+
if (widget) {
|
|
338
|
+
await widgetService.reveal(widget);
|
|
339
|
+
widget.input.openModelPicker();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
class OpenModePickerAction extends Action2 {
|
|
344
|
+
static { this.ID = 'workbench.action.chat.openModePicker'; }
|
|
345
|
+
constructor() {
|
|
346
|
+
super({
|
|
347
|
+
id: OpenModePickerAction.ID,
|
|
348
|
+
title: ( localize2(4724, "Open Agent Picker")),
|
|
349
|
+
tooltip: ( localize(4725, "Set Agent")),
|
|
350
|
+
category: CHAT_CATEGORY,
|
|
351
|
+
f1: false,
|
|
352
|
+
precondition: ChatContextKeys.enabled,
|
|
353
|
+
keybinding: {
|
|
354
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatInput, ( ChatContextKeys.location.isEqualTo(ChatAgentLocation.Chat)))),
|
|
355
|
+
primary: KeyMod.CtrlCmd | KeyCode.Period,
|
|
356
|
+
weight: KeybindingWeight.EditorContrib
|
|
357
|
+
},
|
|
358
|
+
menu: [
|
|
359
|
+
{
|
|
360
|
+
id: MenuId.ChatInput,
|
|
361
|
+
order: 1,
|
|
362
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( ChatContextKeys.location.isEqualTo(ChatAgentLocation.Chat)), ( ChatContextKeys.inQuickChat.negate()), ( ChatContextKeys.lockedToCodingAgent.negate()))),
|
|
363
|
+
group: 'navigation',
|
|
364
|
+
},
|
|
365
|
+
]
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
async run(accessor, ...args) {
|
|
369
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
370
|
+
const widget = widgetService.lastFocusedWidget;
|
|
371
|
+
if (widget) {
|
|
372
|
+
widget.input.openModePicker();
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
class ChatSessionPrimaryPickerAction extends Action2 {
|
|
377
|
+
static { this.ID = 'workbench.action.chat.chatSessionPrimaryPicker'; }
|
|
378
|
+
constructor() {
|
|
379
|
+
super({
|
|
380
|
+
id: ChatSessionPrimaryPickerAction.ID,
|
|
381
|
+
title: ( localize2(4726, "Open Picker")),
|
|
382
|
+
category: CHAT_CATEGORY,
|
|
383
|
+
f1: false,
|
|
384
|
+
precondition: ChatContextKeys.enabled,
|
|
385
|
+
menu: {
|
|
386
|
+
id: MenuId.ChatInput,
|
|
387
|
+
order: 4,
|
|
388
|
+
group: 'navigation',
|
|
389
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.lockedToCodingAgent, ChatContextKeys.chatSessionHasModels))
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
async run(accessor, ...args) {
|
|
394
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
395
|
+
const widget = widgetService.lastFocusedWidget;
|
|
396
|
+
if (widget) {
|
|
397
|
+
widget.input.openChatSessionPicker();
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
const ChangeChatModelActionId = 'workbench.action.chat.changeModel';
|
|
402
|
+
class ChangeChatModelAction extends Action2 {
|
|
403
|
+
static { this.ID = ChangeChatModelActionId; }
|
|
404
|
+
constructor() {
|
|
405
|
+
super({
|
|
406
|
+
id: ChangeChatModelAction.ID,
|
|
407
|
+
title: ( localize2(4727, "Change Model")),
|
|
408
|
+
category: CHAT_CATEGORY,
|
|
409
|
+
f1: false,
|
|
410
|
+
precondition: ChatContextKeys.enabled,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
run(accessor, ...args) {
|
|
414
|
+
const modelInfo = args[0];
|
|
415
|
+
assertType(typeof modelInfo.vendor === 'string' && typeof modelInfo.id === 'string' && typeof modelInfo.family === 'string');
|
|
416
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
417
|
+
const widgets = widgetService.getAllWidgets();
|
|
418
|
+
for (const widget of widgets) {
|
|
419
|
+
widget.input.switchModel(modelInfo);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
class ChatEditingSessionSubmitAction extends SubmitAction {
|
|
424
|
+
static { this.ID = 'workbench.action.edits.submit'; }
|
|
425
|
+
constructor() {
|
|
426
|
+
const menuCondition = ( ChatContextKeys.chatModeKind.notEqualsTo(ChatModeKind.Ask));
|
|
427
|
+
const precondition = ( ContextKeyExpr.and(ChatContextKeys.inputHasText, whenNotInProgress));
|
|
428
|
+
super({
|
|
429
|
+
id: ChatEditingSessionSubmitAction.ID,
|
|
430
|
+
title: ( localize2(4728, "Send")),
|
|
431
|
+
f1: false,
|
|
432
|
+
category: CHAT_CATEGORY,
|
|
433
|
+
icon: Codicon.send,
|
|
434
|
+
precondition,
|
|
435
|
+
menu: [
|
|
436
|
+
{
|
|
437
|
+
id: MenuId.ChatExecute,
|
|
438
|
+
order: 4,
|
|
439
|
+
when: ( ContextKeyExpr.and(( ChatContextKeys.requestInProgress.negate()), menuCondition)),
|
|
440
|
+
group: 'navigation',
|
|
441
|
+
alt: {
|
|
442
|
+
id: 'workbench.action.chat.sendToNewChat',
|
|
443
|
+
title: ( localize2(4719, "Send to New Chat")),
|
|
444
|
+
icon: Codicon.plus
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
class SubmitWithoutDispatchingAction extends Action2 {
|
|
452
|
+
static { this.ID = 'workbench.action.chat.submitWithoutDispatching'; }
|
|
453
|
+
constructor() {
|
|
454
|
+
const precondition = ( ContextKeyExpr.and(ChatContextKeys.inputHasText, whenNotInProgress, ( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Ask))));
|
|
455
|
+
super({
|
|
456
|
+
id: SubmitWithoutDispatchingAction.ID,
|
|
457
|
+
title: ( localize2(4729, "Send")),
|
|
458
|
+
f1: false,
|
|
459
|
+
category: CHAT_CATEGORY,
|
|
460
|
+
precondition,
|
|
461
|
+
keybinding: {
|
|
462
|
+
when: ChatContextKeys.inChatInput,
|
|
463
|
+
primary: KeyMod.Alt | KeyMod.Shift | KeyCode.Enter,
|
|
464
|
+
weight: KeybindingWeight.EditorContrib
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
run(accessor, ...args) {
|
|
469
|
+
const context = args[0];
|
|
470
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
471
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
472
|
+
widget?.acceptInput(context?.inputValue, { noCommandDetection: true });
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
class ChatSubmitWithCodebaseAction extends Action2 {
|
|
476
|
+
static { this.ID = 'workbench.action.chat.submitWithCodebase'; }
|
|
477
|
+
constructor() {
|
|
478
|
+
const precondition = ( ContextKeyExpr.and(ChatContextKeys.inputHasText, whenNotInProgress));
|
|
479
|
+
super({
|
|
480
|
+
id: ChatSubmitWithCodebaseAction.ID,
|
|
481
|
+
title: ( localize2(4730, "Send with {0}", `${chatVariableLeader}codebase`)),
|
|
482
|
+
precondition,
|
|
483
|
+
keybinding: {
|
|
484
|
+
when: ChatContextKeys.inChatInput,
|
|
485
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
486
|
+
weight: KeybindingWeight.EditorContrib
|
|
487
|
+
},
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
run(accessor, ...args) {
|
|
491
|
+
const context = args[0];
|
|
492
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
493
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
494
|
+
if (!widget) {
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const languageModelToolsService = accessor.get(ILanguageModelToolsService);
|
|
498
|
+
const codebaseTool = languageModelToolsService.getToolByName('codebase');
|
|
499
|
+
if (!codebaseTool) {
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
widget.input.attachmentModel.addContext({
|
|
503
|
+
id: codebaseTool.id,
|
|
504
|
+
name: codebaseTool.displayName ?? '',
|
|
505
|
+
fullName: codebaseTool.displayName ?? '',
|
|
506
|
+
value: undefined,
|
|
507
|
+
icon: ThemeIcon.isThemeIcon(codebaseTool.icon) ? codebaseTool.icon : undefined,
|
|
508
|
+
kind: 'tool'
|
|
509
|
+
});
|
|
510
|
+
widget.acceptInput();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
class SendToNewChatAction extends Action2 {
|
|
514
|
+
constructor() {
|
|
515
|
+
const precondition = ChatContextKeys.inputHasText;
|
|
516
|
+
super({
|
|
517
|
+
id: 'workbench.action.chat.sendToNewChat',
|
|
518
|
+
title: ( localize2(4719, "Send to New Chat")),
|
|
519
|
+
precondition,
|
|
520
|
+
category: CHAT_CATEGORY,
|
|
521
|
+
f1: false,
|
|
522
|
+
keybinding: {
|
|
523
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
524
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Enter,
|
|
525
|
+
when: ChatContextKeys.inChatInput,
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
async run(accessor, ...args) {
|
|
530
|
+
const context = args[0];
|
|
531
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
532
|
+
const dialogService = accessor.get(IDialogService);
|
|
533
|
+
const chatService = accessor.get(IChatService);
|
|
534
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
535
|
+
if (!widget) {
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
const inputBeforeClear = widget.getInput();
|
|
539
|
+
if (widget.viewModel) {
|
|
540
|
+
chatService.cancelCurrentRequestForSession(widget.viewModel.sessionResource);
|
|
541
|
+
}
|
|
542
|
+
if (widget.viewModel?.model) {
|
|
543
|
+
if (!(await handleCurrentEditingSession(widget.viewModel.model, undefined, dialogService))) {
|
|
544
|
+
return;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
await widget.clear();
|
|
548
|
+
widget.acceptInput(inputBeforeClear);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const CancelChatActionId = 'workbench.action.chat.cancel';
|
|
552
|
+
class CancelAction extends Action2 {
|
|
553
|
+
static { this.ID = CancelChatActionId; }
|
|
554
|
+
constructor() {
|
|
555
|
+
super({
|
|
556
|
+
id: CancelAction.ID,
|
|
557
|
+
title: ( localize2(4731, "Cancel")),
|
|
558
|
+
f1: false,
|
|
559
|
+
category: CHAT_CATEGORY,
|
|
560
|
+
icon: Codicon.stopCircle,
|
|
561
|
+
menu: [{
|
|
562
|
+
id: MenuId.ChatExecute,
|
|
563
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.requestInProgress, ( ChatContextKeys.remoteJobCreating.negate()))),
|
|
564
|
+
order: 4,
|
|
565
|
+
group: 'navigation',
|
|
566
|
+
}, {
|
|
567
|
+
id: MenuId.ChatEditorInlineExecute,
|
|
568
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.requestInProgress, ( ChatContextKeys.remoteJobCreating.negate()))),
|
|
569
|
+
order: 4,
|
|
570
|
+
group: 'navigation',
|
|
571
|
+
},
|
|
572
|
+
],
|
|
573
|
+
keybinding: {
|
|
574
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
575
|
+
primary: KeyMod.CtrlCmd | KeyCode.Escape,
|
|
576
|
+
win: { primary: KeyMod.Alt | KeyCode.Backspace },
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
run(accessor, ...args) {
|
|
581
|
+
const context = args[0];
|
|
582
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
583
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
584
|
+
if (!widget) {
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
const chatService = accessor.get(IChatService);
|
|
588
|
+
if (widget.viewModel) {
|
|
589
|
+
chatService.cancelCurrentRequestForSession(widget.viewModel.sessionResource);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const CancelChatEditId = 'workbench.edit.chat.cancel';
|
|
594
|
+
class CancelEdit extends Action2 {
|
|
595
|
+
static { this.ID = CancelChatEditId; }
|
|
596
|
+
constructor() {
|
|
597
|
+
super({
|
|
598
|
+
id: CancelEdit.ID,
|
|
599
|
+
title: ( localize2(4732, "Cancel Edit")),
|
|
600
|
+
f1: false,
|
|
601
|
+
category: CHAT_CATEGORY,
|
|
602
|
+
icon: Codicon.x,
|
|
603
|
+
menu: [
|
|
604
|
+
{
|
|
605
|
+
id: MenuId.ChatMessageTitle,
|
|
606
|
+
group: 'navigation',
|
|
607
|
+
order: 1,
|
|
608
|
+
when: ( ContextKeyExpr.and(
|
|
609
|
+
ChatContextKeys.isRequest,
|
|
610
|
+
ChatContextKeys.currentlyEditing,
|
|
611
|
+
( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'input'))
|
|
612
|
+
))
|
|
613
|
+
}
|
|
614
|
+
],
|
|
615
|
+
keybinding: {
|
|
616
|
+
primary: KeyCode.Escape,
|
|
617
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatInput, ( EditorContextKeys.hoverVisible.toNegated()), ( EditorContextKeys.hasNonEmptySelection.toNegated()), ( EditorContextKeys.hasMultipleSelections.toNegated()), ( ContextKeyExpr.or(ChatContextKeys.currentlyEditing, ChatContextKeys.currentlyEditingInput)))),
|
|
618
|
+
weight: KeybindingWeight.EditorContrib - 5
|
|
619
|
+
}
|
|
620
|
+
});
|
|
621
|
+
}
|
|
622
|
+
run(accessor, ...args) {
|
|
623
|
+
const context = args[0];
|
|
624
|
+
const widgetService = accessor.get(IChatWidgetService);
|
|
625
|
+
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
626
|
+
if (!widget) {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
widget.finishedEditing();
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function registerChatExecuteActions() {
|
|
633
|
+
registerAction2(ChatSubmitAction);
|
|
634
|
+
registerAction2(ChatDelegateToEditSessionAction);
|
|
635
|
+
registerAction2(ChatEditingSessionSubmitAction);
|
|
636
|
+
registerAction2(SubmitWithoutDispatchingAction);
|
|
637
|
+
registerAction2(CancelAction);
|
|
638
|
+
registerAction2(SendToNewChatAction);
|
|
639
|
+
registerAction2(ChatSubmitWithCodebaseAction);
|
|
640
|
+
registerAction2(ContinueChatInSessionAction);
|
|
641
|
+
registerAction2(ToggleChatModeAction);
|
|
642
|
+
registerAction2(SwitchToNextModelAction);
|
|
643
|
+
registerAction2(OpenModelPickerAction);
|
|
644
|
+
registerAction2(OpenModePickerAction);
|
|
645
|
+
registerAction2(ChatSessionPrimaryPickerAction);
|
|
646
|
+
registerAction2(ChangeChatModelAction);
|
|
647
|
+
registerAction2(CancelEdit);
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
export { CancelAction, CancelChatActionId, CancelChatEditId, CancelEdit, ChangeChatModelActionId, ChatDelegateToEditSessionAction, ChatEditingSessionSubmitAction, ChatOpenModelPickerActionId, ChatSessionPrimaryPickerAction, ChatSubmitAction, ChatSubmitWithCodebaseAction, OpenModePickerAction, ToggleAgentModeActionId, registerChatExecuteActions };
|