@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,43 @@
|
|
|
1
|
+
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
+
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
4
|
+
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
5
|
+
import { IInstantiationService, ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
7
|
+
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
8
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
9
|
+
import { IChatAgentCommand, IChatAgentData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents";
|
|
10
|
+
import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
|
|
11
|
+
import { IParsedChatRequest } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatParserTypes";
|
|
12
|
+
import { IChatMarkdownContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
|
|
13
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
14
|
+
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service";
|
|
15
|
+
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
16
|
+
import { IChatMarkdownAnchorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.service";
|
|
17
|
+
export declare function agentToMarkdown(agent: IChatAgentData, sessionResource: URI, isClickable: boolean, accessor: ServicesAccessor): string;
|
|
18
|
+
export declare function agentSlashCommandToMarkdown(agent: IChatAgentData, command: IChatAgentCommand, sessionResource: URI): string;
|
|
19
|
+
export interface IDecorationWidgetArgs {
|
|
20
|
+
title?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class ChatMarkdownDecorationsRenderer {
|
|
23
|
+
private readonly keybindingService;
|
|
24
|
+
private readonly logService;
|
|
25
|
+
private readonly chatAgentService;
|
|
26
|
+
private readonly instantiationService;
|
|
27
|
+
private readonly hoverService;
|
|
28
|
+
private readonly chatService;
|
|
29
|
+
private readonly chatWidgetService;
|
|
30
|
+
private readonly commandService;
|
|
31
|
+
private readonly labelService;
|
|
32
|
+
private readonly toolsService;
|
|
33
|
+
private readonly chatMarkdownAnchorService;
|
|
34
|
+
constructor(keybindingService: IKeybindingService, logService: ILogService, chatAgentService: IChatAgentService, instantiationService: IInstantiationService, hoverService: IHoverService, chatService: IChatService, chatWidgetService: IChatWidgetService, commandService: ICommandService, labelService: ILabelService, toolsService: ILanguageModelToolsService, chatMarkdownAnchorService: IChatMarkdownAnchorService);
|
|
35
|
+
convertParsedRequestToMarkdown(sessionResource: URI, parsedRequest: IParsedChatRequest): string;
|
|
36
|
+
private genericDecorationToMarkdown;
|
|
37
|
+
walkTreeAndAnnotateReferenceLinks(content: IChatMarkdownContent, element: HTMLElement): IDisposable;
|
|
38
|
+
private renderAgentWidget;
|
|
39
|
+
private renderSlashCommandWidget;
|
|
40
|
+
private renderFileWidget;
|
|
41
|
+
private renderResourceWidget;
|
|
42
|
+
private injectKeybindingHint;
|
|
43
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import { $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
|
+
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
6
|
+
import { getDefaultHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
7
|
+
import { toErrorMessage } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errorMessage';
|
|
8
|
+
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
9
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
10
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
11
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
12
|
+
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
13
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
15
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
16
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
17
|
+
import { asCssVariable } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
18
|
+
import { contentRefUrl } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/annotations';
|
|
19
|
+
import { getFullyQualifiedId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
20
|
+
import { IChatAgentNameService, IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
21
|
+
import { chatSlashCommandForeground, chatSlashCommandBackground } from '../common/chatColors.js';
|
|
22
|
+
import { chatSubcommandLeader, ChatRequestTextPart, ChatRequestAgentPart, ChatRequestDynamicVariablePart, ChatRequestSlashCommandPart, ChatRequestAgentSubcommandPart, ChatRequestSlashPromptPart, ChatRequestToolPart, chatAgentLeader } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
23
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
24
|
+
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
25
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
26
|
+
import { ChatAgentHover, getChatAgentHoverOptions } from './chatAgentHover.js';
|
|
27
|
+
import { IChatMarkdownAnchorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.service';
|
|
28
|
+
import { InlineAnchorWidget } from './chatInlineAnchorWidget.js';
|
|
29
|
+
import * as chatInlineAnchorWidget from './media/chatInlineAnchorWidget.css';
|
|
30
|
+
|
|
31
|
+
registerCss(chatInlineAnchorWidget);
|
|
32
|
+
const decorationRefUrl = `http://_vscodedecoration_`;
|
|
33
|
+
const agentRefUrl = `http://_chatagent_`;
|
|
34
|
+
const agentSlashRefUrl = `http://_chatslash_`;
|
|
35
|
+
function agentToMarkdown(agent, sessionResource, isClickable, accessor) {
|
|
36
|
+
const chatAgentNameService = accessor.get(IChatAgentNameService);
|
|
37
|
+
const chatAgentService = accessor.get(IChatAgentService);
|
|
38
|
+
const isAllowed = chatAgentNameService.getAgentNameRestriction(agent);
|
|
39
|
+
let name = `${isAllowed ? agent.name : getFullyQualifiedId(agent)}`;
|
|
40
|
+
const isDupe = isAllowed && chatAgentService.agentHasDupeName(agent.id);
|
|
41
|
+
if (isDupe) {
|
|
42
|
+
name += ` (${agent.publisherDisplayName})`;
|
|
43
|
+
}
|
|
44
|
+
const args = { agentId: agent.id, sessionResource, name, isClickable };
|
|
45
|
+
return `[${agent.name}](${agentRefUrl}?${encodeURIComponent(JSON.stringify(args))})`;
|
|
46
|
+
}
|
|
47
|
+
function agentSlashCommandToMarkdown(agent, command, sessionResource) {
|
|
48
|
+
const text = `${chatSubcommandLeader}${command.name}`;
|
|
49
|
+
const args = { agentId: agent.id, command: command.name, sessionResource };
|
|
50
|
+
return `[${text}](${agentSlashRefUrl}?${encodeURIComponent(JSON.stringify(args))})`;
|
|
51
|
+
}
|
|
52
|
+
let ChatMarkdownDecorationsRenderer = class ChatMarkdownDecorationsRenderer {
|
|
53
|
+
constructor(keybindingService, logService, chatAgentService, instantiationService, hoverService, chatService, chatWidgetService, commandService, labelService, toolsService, chatMarkdownAnchorService) {
|
|
54
|
+
this.keybindingService = keybindingService;
|
|
55
|
+
this.logService = logService;
|
|
56
|
+
this.chatAgentService = chatAgentService;
|
|
57
|
+
this.instantiationService = instantiationService;
|
|
58
|
+
this.hoverService = hoverService;
|
|
59
|
+
this.chatService = chatService;
|
|
60
|
+
this.chatWidgetService = chatWidgetService;
|
|
61
|
+
this.commandService = commandService;
|
|
62
|
+
this.labelService = labelService;
|
|
63
|
+
this.toolsService = toolsService;
|
|
64
|
+
this.chatMarkdownAnchorService = chatMarkdownAnchorService;
|
|
65
|
+
}
|
|
66
|
+
convertParsedRequestToMarkdown(sessionResource, parsedRequest) {
|
|
67
|
+
let result = '';
|
|
68
|
+
for (const part of parsedRequest.parts) {
|
|
69
|
+
if (part instanceof ChatRequestTextPart) {
|
|
70
|
+
result += part.text;
|
|
71
|
+
}
|
|
72
|
+
else if (part instanceof ChatRequestAgentPart) {
|
|
73
|
+
result += this.instantiationService.invokeFunction(accessor => agentToMarkdown(part.agent, sessionResource, false, accessor));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
result += this.genericDecorationToMarkdown(part);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
genericDecorationToMarkdown(part) {
|
|
82
|
+
const uri = part instanceof ChatRequestDynamicVariablePart && part.data instanceof URI ?
|
|
83
|
+
part.data :
|
|
84
|
+
undefined;
|
|
85
|
+
const title = uri ? this.labelService.getUriLabel(uri, { relative: true }) :
|
|
86
|
+
part instanceof ChatRequestSlashCommandPart ? part.slashCommand.detail :
|
|
87
|
+
part instanceof ChatRequestAgentSubcommandPart ? part.command.description :
|
|
88
|
+
part instanceof ChatRequestSlashPromptPart ? part.name :
|
|
89
|
+
part instanceof ChatRequestToolPart ? (this.toolsService.getTool(part.toolId)?.userDescription) :
|
|
90
|
+
'';
|
|
91
|
+
const args = { title };
|
|
92
|
+
const text = part.text;
|
|
93
|
+
return `[${text}](${decorationRefUrl}?${encodeURIComponent(JSON.stringify(args))})`;
|
|
94
|
+
}
|
|
95
|
+
walkTreeAndAnnotateReferenceLinks(content, element) {
|
|
96
|
+
const store = ( new DisposableStore());
|
|
97
|
+
element.querySelectorAll('a').forEach(a => {
|
|
98
|
+
const href = a.getAttribute('data-href');
|
|
99
|
+
if (href) {
|
|
100
|
+
if (href.startsWith(agentRefUrl)) {
|
|
101
|
+
let args;
|
|
102
|
+
try {
|
|
103
|
+
args = JSON.parse(decodeURIComponent(href.slice(agentRefUrl.length + 1)));
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
this.logService.error('Invalid chat widget render data JSON', toErrorMessage(e));
|
|
107
|
+
}
|
|
108
|
+
if (args) {
|
|
109
|
+
a.replaceWith(this.renderAgentWidget(args, store));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else if (href.startsWith(agentSlashRefUrl)) {
|
|
113
|
+
let args;
|
|
114
|
+
try {
|
|
115
|
+
args = JSON.parse(decodeURIComponent(href.slice(agentRefUrl.length + 1)));
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
this.logService.error('Invalid chat slash command render data JSON', toErrorMessage(e));
|
|
119
|
+
}
|
|
120
|
+
if (args) {
|
|
121
|
+
a.replaceWith(this.renderSlashCommandWidget(a.textContent, args, store));
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (href.startsWith(decorationRefUrl)) {
|
|
125
|
+
let args;
|
|
126
|
+
try {
|
|
127
|
+
args = JSON.parse(decodeURIComponent(href.slice(decorationRefUrl.length + 1)));
|
|
128
|
+
}
|
|
129
|
+
catch (e) { }
|
|
130
|
+
a.replaceWith(this.renderResourceWidget(a.textContent, args, store));
|
|
131
|
+
}
|
|
132
|
+
else if (href.startsWith(contentRefUrl)) {
|
|
133
|
+
this.renderFileWidget(content, href, a, store);
|
|
134
|
+
}
|
|
135
|
+
else if (href.startsWith('command:')) {
|
|
136
|
+
this.injectKeybindingHint(a, href, this.keybindingService);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return store;
|
|
141
|
+
}
|
|
142
|
+
renderAgentWidget(args, store) {
|
|
143
|
+
const nameWithLeader = `${chatAgentLeader}${args.name}`;
|
|
144
|
+
let container;
|
|
145
|
+
if (args.isClickable) {
|
|
146
|
+
container = $('span.chat-agent-widget');
|
|
147
|
+
const button = store.add(( new Button(container, {
|
|
148
|
+
buttonBackground: asCssVariable(chatSlashCommandBackground),
|
|
149
|
+
buttonForeground: asCssVariable(chatSlashCommandForeground),
|
|
150
|
+
buttonHoverBackground: undefined
|
|
151
|
+
})));
|
|
152
|
+
button.label = nameWithLeader;
|
|
153
|
+
store.add(button.onDidClick(() => {
|
|
154
|
+
const agent = this.chatAgentService.getAgent(args.agentId);
|
|
155
|
+
const widget = this.chatWidgetService.getWidgetBySessionResource(args.sessionResource) || this.chatWidgetService.lastFocusedWidget;
|
|
156
|
+
if (!widget || !agent) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
this.chatService.sendRequest(widget.viewModel.sessionResource, agent.metadata.sampleRequest ?? '', {
|
|
160
|
+
location: widget.location,
|
|
161
|
+
agentId: agent.id,
|
|
162
|
+
userSelectedModelId: widget.input.currentLanguageModel,
|
|
163
|
+
modeInfo: widget.input.currentModeInfo
|
|
164
|
+
});
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
container = this.renderResourceWidget(nameWithLeader, undefined, store);
|
|
169
|
+
}
|
|
170
|
+
const agent = this.chatAgentService.getAgent(args.agentId);
|
|
171
|
+
const hover = ( new Lazy(() => store.add(this.instantiationService.createInstance(ChatAgentHover))));
|
|
172
|
+
store.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), container, () => {
|
|
173
|
+
hover.value.setAgent(args.agentId);
|
|
174
|
+
return hover.value.domNode;
|
|
175
|
+
}, agent && getChatAgentHoverOptions(() => agent, this.commandService)));
|
|
176
|
+
return container;
|
|
177
|
+
}
|
|
178
|
+
renderSlashCommandWidget(name, args, store) {
|
|
179
|
+
const container = $('span.chat-agent-widget.chat-command-widget');
|
|
180
|
+
const agent = this.chatAgentService.getAgent(args.agentId);
|
|
181
|
+
const button = store.add(( new Button(container, {
|
|
182
|
+
buttonBackground: asCssVariable(chatSlashCommandBackground),
|
|
183
|
+
buttonForeground: asCssVariable(chatSlashCommandForeground),
|
|
184
|
+
buttonHoverBackground: undefined
|
|
185
|
+
})));
|
|
186
|
+
button.label = name;
|
|
187
|
+
store.add(button.onDidClick(() => {
|
|
188
|
+
const widget = this.chatWidgetService.getWidgetBySessionResource(args.sessionResource) || this.chatWidgetService.lastFocusedWidget;
|
|
189
|
+
if (!widget || !agent) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const command = agent.slashCommands.find(c => c.name === args.command);
|
|
193
|
+
this.chatService.sendRequest(widget.viewModel.sessionResource, command?.sampleRequest ?? '', {
|
|
194
|
+
location: widget.location,
|
|
195
|
+
agentId: agent.id,
|
|
196
|
+
slashCommand: args.command,
|
|
197
|
+
userSelectedModelId: widget.input.currentLanguageModel,
|
|
198
|
+
modeInfo: widget.input.currentModeInfo
|
|
199
|
+
});
|
|
200
|
+
}));
|
|
201
|
+
return container;
|
|
202
|
+
}
|
|
203
|
+
renderFileWidget(content, href, a, store) {
|
|
204
|
+
const fullUri = ( URI.parse(href));
|
|
205
|
+
const data = content.inlineReferences?.[fullUri.path.slice(1)];
|
|
206
|
+
if (!data) {
|
|
207
|
+
this.logService.error('Invalid chat widget render data JSON');
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
const inlineAnchor = store.add(this.instantiationService.createInstance(InlineAnchorWidget, a, data));
|
|
211
|
+
store.add(this.chatMarkdownAnchorService.register(inlineAnchor));
|
|
212
|
+
}
|
|
213
|
+
renderResourceWidget(name, args, store) {
|
|
214
|
+
const container = $('span.chat-resource-widget');
|
|
215
|
+
const alias = $('span', undefined, name);
|
|
216
|
+
if (args?.title) {
|
|
217
|
+
store.add(this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), container, args.title));
|
|
218
|
+
}
|
|
219
|
+
container.appendChild(alias);
|
|
220
|
+
return container;
|
|
221
|
+
}
|
|
222
|
+
injectKeybindingHint(a, href, keybindingService) {
|
|
223
|
+
const command = href.match(/command:([^\)]+)/)?.[1];
|
|
224
|
+
if (command) {
|
|
225
|
+
const kb = keybindingService.lookupKeybinding(command);
|
|
226
|
+
if (kb) {
|
|
227
|
+
const keybinding = kb.getLabel();
|
|
228
|
+
if (keybinding) {
|
|
229
|
+
a.textContent = `${a.textContent} (${keybinding})`;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
ChatMarkdownDecorationsRenderer = ( __decorate([
|
|
236
|
+
( __param(0, IKeybindingService)),
|
|
237
|
+
( __param(1, ILogService)),
|
|
238
|
+
( __param(2, IChatAgentService)),
|
|
239
|
+
( __param(3, IInstantiationService)),
|
|
240
|
+
( __param(4, IHoverService)),
|
|
241
|
+
( __param(5, IChatService)),
|
|
242
|
+
( __param(6, IChatWidgetService)),
|
|
243
|
+
( __param(7, ICommandService)),
|
|
244
|
+
( __param(8, ILabelService)),
|
|
245
|
+
( __param(9, ILanguageModelToolsService)),
|
|
246
|
+
( __param(10, IChatMarkdownAnchorService))
|
|
247
|
+
], ChatMarkdownDecorationsRenderer));
|
|
248
|
+
|
|
249
|
+
export { ChatMarkdownDecorationsRenderer, agentSlashCommandToMarkdown, agentToMarkdown };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Color } from "@codingame/monaco-vscode-api/vscode/vs/base/common/color";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IBracketPairColorizationOptions } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
6
|
+
import { IViewDescriptorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service";
|
|
7
|
+
export interface IChatConfiguration {
|
|
8
|
+
editor: {
|
|
9
|
+
readonly fontSize: number;
|
|
10
|
+
readonly fontFamily: string;
|
|
11
|
+
readonly lineHeight: number;
|
|
12
|
+
readonly fontWeight: string;
|
|
13
|
+
readonly wordWrap: "off" | "on";
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface IChatEditorConfiguration {
|
|
17
|
+
readonly foreground: Color | undefined;
|
|
18
|
+
readonly inputEditor: IChatInputEditorOptions;
|
|
19
|
+
readonly resultEditor: IChatResultEditorOptions;
|
|
20
|
+
}
|
|
21
|
+
export interface IChatInputEditorOptions {
|
|
22
|
+
readonly backgroundColor: Color | undefined;
|
|
23
|
+
readonly accessibilitySupport: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IChatResultEditorOptions {
|
|
26
|
+
readonly fontSize: number;
|
|
27
|
+
readonly fontFamily: string | undefined;
|
|
28
|
+
readonly lineHeight: number;
|
|
29
|
+
readonly fontWeight: string;
|
|
30
|
+
readonly backgroundColor: Color | undefined;
|
|
31
|
+
readonly bracketPairColorization: IBracketPairColorizationOptions;
|
|
32
|
+
readonly fontLigatures: boolean | string | undefined;
|
|
33
|
+
readonly wordWrap: "off" | "on";
|
|
34
|
+
}
|
|
35
|
+
export declare class ChatEditorOptions extends Disposable {
|
|
36
|
+
private readonly foreground;
|
|
37
|
+
private readonly inputEditorBackgroundColor;
|
|
38
|
+
private readonly resultEditorBackgroundColor;
|
|
39
|
+
private readonly configurationService;
|
|
40
|
+
private readonly themeService;
|
|
41
|
+
private readonly viewDescriptorService;
|
|
42
|
+
private static readonly lineHeightEm;
|
|
43
|
+
private readonly _onDidChange;
|
|
44
|
+
readonly onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
45
|
+
private _config;
|
|
46
|
+
get configuration(): IChatEditorConfiguration;
|
|
47
|
+
private static readonly relevantSettingIds;
|
|
48
|
+
constructor(viewId: string | undefined, foreground: string, inputEditorBackgroundColor: string, resultEditorBackgroundColor: string, configurationService: IConfigurationService, themeService: IThemeService, viewDescriptorService: IViewDescriptorService);
|
|
49
|
+
private update;
|
|
50
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
6
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
7
|
+
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
8
|
+
|
|
9
|
+
var ChatEditorOptions_1;
|
|
10
|
+
let ChatEditorOptions = class ChatEditorOptions extends Disposable {
|
|
11
|
+
static { ChatEditorOptions_1 = this; }
|
|
12
|
+
static { this.lineHeightEm = 1.4; }
|
|
13
|
+
get configuration() {
|
|
14
|
+
return this._config;
|
|
15
|
+
}
|
|
16
|
+
static { this.relevantSettingIds = [
|
|
17
|
+
'chat.editor.lineHeight',
|
|
18
|
+
'chat.editor.fontSize',
|
|
19
|
+
'chat.editor.fontFamily',
|
|
20
|
+
'chat.editor.fontWeight',
|
|
21
|
+
'chat.editor.wordWrap',
|
|
22
|
+
'editor.cursorBlinking',
|
|
23
|
+
'editor.fontLigatures',
|
|
24
|
+
'editor.accessibilitySupport',
|
|
25
|
+
'editor.bracketPairColorization.enabled',
|
|
26
|
+
'editor.bracketPairColorization.independentColorPoolPerBracketType',
|
|
27
|
+
]; }
|
|
28
|
+
constructor(viewId, foreground, inputEditorBackgroundColor, resultEditorBackgroundColor, configurationService, themeService, viewDescriptorService) {
|
|
29
|
+
super();
|
|
30
|
+
this.foreground = foreground;
|
|
31
|
+
this.inputEditorBackgroundColor = inputEditorBackgroundColor;
|
|
32
|
+
this.resultEditorBackgroundColor = resultEditorBackgroundColor;
|
|
33
|
+
this.configurationService = configurationService;
|
|
34
|
+
this.themeService = themeService;
|
|
35
|
+
this.viewDescriptorService = viewDescriptorService;
|
|
36
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
37
|
+
this.onDidChange = this._onDidChange.event;
|
|
38
|
+
this._register(this.themeService.onDidColorThemeChange(e => this.update()));
|
|
39
|
+
this._register(this.viewDescriptorService.onDidChangeLocation(e => {
|
|
40
|
+
if (( e.views.some(v => v.id === viewId))) {
|
|
41
|
+
this.update();
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
45
|
+
if (( ChatEditorOptions_1.relevantSettingIds.some(id => e.affectsConfiguration(id)))) {
|
|
46
|
+
this.update();
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
this.update();
|
|
50
|
+
}
|
|
51
|
+
update() {
|
|
52
|
+
const editorConfig = this.configurationService.getValue('editor');
|
|
53
|
+
const chatEditorConfig = this.configurationService.getValue('chat')?.editor;
|
|
54
|
+
const accessibilitySupport = this.configurationService.getValue('editor.accessibilitySupport');
|
|
55
|
+
this._config = {
|
|
56
|
+
foreground: this.themeService.getColorTheme().getColor(this.foreground),
|
|
57
|
+
inputEditor: {
|
|
58
|
+
backgroundColor: this.themeService.getColorTheme().getColor(this.inputEditorBackgroundColor),
|
|
59
|
+
accessibilitySupport,
|
|
60
|
+
},
|
|
61
|
+
resultEditor: {
|
|
62
|
+
backgroundColor: this.themeService.getColorTheme().getColor(this.resultEditorBackgroundColor),
|
|
63
|
+
fontSize: chatEditorConfig.fontSize,
|
|
64
|
+
fontFamily: chatEditorConfig.fontFamily === 'default' ? editorConfig.fontFamily : chatEditorConfig.fontFamily,
|
|
65
|
+
fontWeight: chatEditorConfig.fontWeight,
|
|
66
|
+
lineHeight: chatEditorConfig.lineHeight ? chatEditorConfig.lineHeight : ChatEditorOptions_1.lineHeightEm * chatEditorConfig.fontSize,
|
|
67
|
+
bracketPairColorization: {
|
|
68
|
+
enabled: this.configurationService.getValue('editor.bracketPairColorization.enabled'),
|
|
69
|
+
independentColorPoolPerBracketType: this.configurationService.getValue('editor.bracketPairColorization.independentColorPoolPerBracketType'),
|
|
70
|
+
},
|
|
71
|
+
wordWrap: chatEditorConfig.wordWrap,
|
|
72
|
+
fontLigatures: editorConfig.fontLigatures,
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
this._onDidChange.fire();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
ChatEditorOptions = ChatEditorOptions_1 = ( __decorate([
|
|
79
|
+
( __param(4, IConfigurationService)),
|
|
80
|
+
( __param(5, IThemeService)),
|
|
81
|
+
( __param(6, IViewDescriptorService))
|
|
82
|
+
], ChatEditorOptions));
|
|
83
|
+
|
|
84
|
+
export { ChatEditorOptions };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
5
|
+
import { UserSelectedTools } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents";
|
|
6
|
+
import { IChatMode } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes";
|
|
7
|
+
import { IToolAndToolSetEnablementMap } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService";
|
|
8
|
+
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service";
|
|
9
|
+
export declare enum ToolsScope {
|
|
10
|
+
Global = 0,
|
|
11
|
+
Session = 1,
|
|
12
|
+
Agent = 2,
|
|
13
|
+
Agent_ReadOnly = 3
|
|
14
|
+
}
|
|
15
|
+
export declare class ChatSelectedTools extends Disposable {
|
|
16
|
+
private readonly _mode;
|
|
17
|
+
private readonly _toolsService;
|
|
18
|
+
private readonly _instantiationService;
|
|
19
|
+
private readonly _globalState;
|
|
20
|
+
private readonly _sessionStates;
|
|
21
|
+
constructor(_mode: IObservable<IChatMode>, _toolsService: ILanguageModelToolsService, _storageService: IStorageService, _instantiationService: IInstantiationService);
|
|
22
|
+
/**
|
|
23
|
+
* All tools and tool sets with their enabled state.
|
|
24
|
+
*/
|
|
25
|
+
readonly entriesMap: IObservable<IToolAndToolSetEnablementMap>;
|
|
26
|
+
readonly userSelectedTools: IObservable<UserSelectedTools>;
|
|
27
|
+
get entriesScope(): ToolsScope;
|
|
28
|
+
get currentMode(): IChatMode;
|
|
29
|
+
resetSessionEnablementState(): void;
|
|
30
|
+
set(enablementMap: IToolAndToolSetEnablementMap, sessionOnly: boolean): void;
|
|
31
|
+
private updateCustomModeTools;
|
|
32
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
6
|
+
import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { observableMemento } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/observableMemento';
|
|
9
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
10
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
11
|
+
import { ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
12
|
+
import { ToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
13
|
+
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
14
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
15
|
+
import { PromptFileRewriter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/promptSyntax/promptFileRewriter';
|
|
16
|
+
import { ObservableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/map';
|
|
17
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
18
|
+
|
|
19
|
+
var ToolEnablementStates;
|
|
20
|
+
(function (ToolEnablementStates) {
|
|
21
|
+
function fromMap(map) {
|
|
22
|
+
const toolSets = ( new Map()), tools = ( new Map());
|
|
23
|
+
for (const [entry, enabled] of map.entries()) {
|
|
24
|
+
if (entry instanceof ToolSet) {
|
|
25
|
+
toolSets.set(entry.id, enabled);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
tools.set(entry.id, enabled);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return { toolSets, tools };
|
|
32
|
+
}
|
|
33
|
+
ToolEnablementStates.fromMap = fromMap;
|
|
34
|
+
function isStoredDataV1(data) {
|
|
35
|
+
return isObject(data) && data.version === undefined
|
|
36
|
+
&& (data.disabledTools === undefined || Array.isArray(data.disabledTools))
|
|
37
|
+
&& (data.disabledToolSets === undefined || Array.isArray(data.disabledToolSets));
|
|
38
|
+
}
|
|
39
|
+
function isStoredDataV2(data) {
|
|
40
|
+
return isObject(data) && data.version === 2 && Array.isArray(data.toolSetEntries) && Array.isArray(data.toolEntries);
|
|
41
|
+
}
|
|
42
|
+
function fromStorage(storage) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = JSON.parse(storage);
|
|
45
|
+
if (isStoredDataV2(parsed)) {
|
|
46
|
+
return { toolSets: ( new Map(parsed.toolSetEntries)), tools: ( new Map(parsed.toolEntries)) };
|
|
47
|
+
}
|
|
48
|
+
else if (isStoredDataV1(parsed)) {
|
|
49
|
+
const toolSetEntries = parsed.disabledToolSets?.map(id => [id, false]);
|
|
50
|
+
const toolEntries = parsed.disabledTools?.map(id => [id, false]);
|
|
51
|
+
return { toolSets: ( new Map(toolSetEntries)), tools: ( new Map(toolEntries)) };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
}
|
|
56
|
+
return { toolSets: ( new Map()), tools: ( new Map()) };
|
|
57
|
+
}
|
|
58
|
+
ToolEnablementStates.fromStorage = fromStorage;
|
|
59
|
+
function toStorage(state) {
|
|
60
|
+
const storageData = {
|
|
61
|
+
version: 2,
|
|
62
|
+
toolSetEntries: Array.from(state.toolSets.entries()),
|
|
63
|
+
toolEntries: Array.from(state.tools.entries())
|
|
64
|
+
};
|
|
65
|
+
return JSON.stringify(storageData);
|
|
66
|
+
}
|
|
67
|
+
ToolEnablementStates.toStorage = toStorage;
|
|
68
|
+
})(ToolEnablementStates || (ToolEnablementStates = {}));
|
|
69
|
+
var ToolsScope;
|
|
70
|
+
(function (ToolsScope) {
|
|
71
|
+
ToolsScope[ToolsScope["Global"] = 0] = "Global";
|
|
72
|
+
ToolsScope[ToolsScope["Session"] = 1] = "Session";
|
|
73
|
+
ToolsScope[ToolsScope["Agent"] = 2] = "Agent";
|
|
74
|
+
ToolsScope[ToolsScope["Agent_ReadOnly"] = 3] = "Agent_ReadOnly";
|
|
75
|
+
})(ToolsScope || (ToolsScope = {}));
|
|
76
|
+
let ChatSelectedTools = class ChatSelectedTools extends Disposable {
|
|
77
|
+
constructor(_mode, _toolsService, _storageService, _instantiationService) {
|
|
78
|
+
super();
|
|
79
|
+
this._mode = _mode;
|
|
80
|
+
this._toolsService = _toolsService;
|
|
81
|
+
this._instantiationService = _instantiationService;
|
|
82
|
+
this._sessionStates = ( new ObservableMap());
|
|
83
|
+
this.entriesMap = derived(r => {
|
|
84
|
+
const map = ( new Map());
|
|
85
|
+
const currentMode = this._mode.read(r);
|
|
86
|
+
let currentMap = this._sessionStates.observable.read(r).get(currentMode.id);
|
|
87
|
+
if (!currentMap && currentMode.kind === ChatModeKind.Agent) {
|
|
88
|
+
const modeTools = currentMode.customTools?.read(r);
|
|
89
|
+
if (modeTools) {
|
|
90
|
+
const target = currentMode.target?.read(r);
|
|
91
|
+
currentMap = ToolEnablementStates.fromMap(this._toolsService.toToolAndToolSetEnablementMap(modeTools, target));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (!currentMap) {
|
|
95
|
+
currentMap = this._globalState.read(r);
|
|
96
|
+
}
|
|
97
|
+
for (const tool of this._toolsService.toolsObservable.read(r)) {
|
|
98
|
+
if (tool.canBeReferencedInPrompt) {
|
|
99
|
+
map.set(tool, currentMap.tools.get(tool.id) !== false);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
for (const toolSet of this._toolsService.toolSets.read(r)) {
|
|
103
|
+
const toolSetEnabled = currentMap.toolSets.get(toolSet.id) !== false;
|
|
104
|
+
map.set(toolSet, toolSetEnabled);
|
|
105
|
+
for (const tool of toolSet.getTools(r)) {
|
|
106
|
+
map.set(tool, toolSetEnabled || currentMap.tools.get(tool.id) === true);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return map;
|
|
110
|
+
});
|
|
111
|
+
this.userSelectedTools = derived(r => {
|
|
112
|
+
const result = {};
|
|
113
|
+
const map = this.entriesMap.read(r);
|
|
114
|
+
for (const [item, enabled] of map) {
|
|
115
|
+
if (!(item instanceof ToolSet)) {
|
|
116
|
+
result[item.id] = enabled;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
});
|
|
121
|
+
const globalStateMemento = observableMemento({
|
|
122
|
+
key: 'chat/selectedTools',
|
|
123
|
+
defaultValue: { toolSets: ( new Map()), tools: ( new Map()) },
|
|
124
|
+
fromStorage: ToolEnablementStates.fromStorage,
|
|
125
|
+
toStorage: ToolEnablementStates.toStorage
|
|
126
|
+
});
|
|
127
|
+
this._globalState = this._store.add(globalStateMemento(StorageScope.PROFILE, StorageTarget.MACHINE, _storageService));
|
|
128
|
+
}
|
|
129
|
+
get entriesScope() {
|
|
130
|
+
const mode = this._mode.get();
|
|
131
|
+
if (( this._sessionStates.has(mode.id))) {
|
|
132
|
+
return ToolsScope.Session;
|
|
133
|
+
}
|
|
134
|
+
if (mode.kind === ChatModeKind.Agent && mode.customTools?.get() && mode.uri) {
|
|
135
|
+
return mode.source?.storage !== PromptsStorage.extension ? ToolsScope.Agent : ToolsScope.Agent_ReadOnly;
|
|
136
|
+
}
|
|
137
|
+
return ToolsScope.Global;
|
|
138
|
+
}
|
|
139
|
+
get currentMode() {
|
|
140
|
+
return this._mode.get();
|
|
141
|
+
}
|
|
142
|
+
resetSessionEnablementState() {
|
|
143
|
+
const mode = this._mode.get();
|
|
144
|
+
this._sessionStates.delete(mode.id);
|
|
145
|
+
}
|
|
146
|
+
set(enablementMap, sessionOnly) {
|
|
147
|
+
const mode = this._mode.get();
|
|
148
|
+
if (sessionOnly || ( this._sessionStates.has(mode.id))) {
|
|
149
|
+
this._sessionStates.set(mode.id, ToolEnablementStates.fromMap(enablementMap));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
if (mode.kind === ChatModeKind.Agent && mode.customTools?.get() && mode.uri) {
|
|
153
|
+
if (mode.source?.storage !== PromptsStorage.extension) {
|
|
154
|
+
this.updateCustomModeTools(mode.uri.get(), enablementMap);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this._sessionStates.set(mode.id, ToolEnablementStates.fromMap(enablementMap));
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
this._globalState.set(ToolEnablementStates.fromMap(enablementMap), undefined);
|
|
163
|
+
}
|
|
164
|
+
async updateCustomModeTools(uri, enablementMap) {
|
|
165
|
+
await this._instantiationService.createInstance(PromptFileRewriter).openAndRewriteTools(uri, enablementMap, CancellationToken.None);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
ChatSelectedTools = ( __decorate([
|
|
169
|
+
( __param(1, ILanguageModelToolsService)),
|
|
170
|
+
( __param(2, IStorageService)),
|
|
171
|
+
( __param(3, IInstantiationService))
|
|
172
|
+
], ChatSelectedTools));
|
|
173
|
+
|
|
174
|
+
export { ChatSelectedTools, ToolsScope };
|