@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
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js
ADDED
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { splitGlobAware, match } from '@codingame/monaco-vscode-api/vscode/vs/base/common/glob';
|
|
4
|
+
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
5
|
+
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
6
|
+
import { dirname, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
7
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
10
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
11
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
13
|
+
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
14
|
+
import { toPromptFileVariableEntry, PromptFileVariableKind, isPromptFileVariableEntry, IChatRequestVariableEntry, ChatRequestVariableSet, toToolVariableEntry, toPromptTextVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries';
|
|
15
|
+
import { VSCodeToolReference } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
16
|
+
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
17
|
+
import { PromptsConfig } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/config';
|
|
18
|
+
import { isPromptOrInstructionsFile } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
19
|
+
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
20
|
+
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
21
|
+
import { OffsetRange } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/offsetRange';
|
|
22
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
23
|
+
|
|
24
|
+
function newInstructionsCollectionEvent() {
|
|
25
|
+
return { applyingInstructionsCount: 0, referencedInstructionsCount: 0, agentInstructionsCount: 0, listedInstructionsCount: 0, totalInstructionsCount: 0 };
|
|
26
|
+
}
|
|
27
|
+
let ComputeAutomaticInstructions = class ComputeAutomaticInstructions {
|
|
28
|
+
constructor(_enabledTools, _promptsService, _logService, _labelService, _configurationService, _workspaceService, _fileService, _telemetryService, _languageModelToolsService) {
|
|
29
|
+
this._enabledTools = _enabledTools;
|
|
30
|
+
this._promptsService = _promptsService;
|
|
31
|
+
this._logService = _logService;
|
|
32
|
+
this._labelService = _labelService;
|
|
33
|
+
this._configurationService = _configurationService;
|
|
34
|
+
this._workspaceService = _workspaceService;
|
|
35
|
+
this._fileService = _fileService;
|
|
36
|
+
this._telemetryService = _telemetryService;
|
|
37
|
+
this._languageModelToolsService = _languageModelToolsService;
|
|
38
|
+
this._parseResults = ( new ResourceMap());
|
|
39
|
+
}
|
|
40
|
+
async _parseInstructionsFile(uri, token) {
|
|
41
|
+
if (( this._parseResults.has(uri))) {
|
|
42
|
+
return this._parseResults.get(uri);
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const result = await this._promptsService.parseNew(uri, token);
|
|
46
|
+
this._parseResults.set(uri, result);
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
this._logService.error(`[InstructionsContextComputer] Failed to parse instruction file: ${uri}`, error);
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async collect(variables, token) {
|
|
55
|
+
const instructionFiles = await this._promptsService.listPromptFiles(PromptsType.instructions, token);
|
|
56
|
+
this._logService.trace(`[InstructionsContextComputer] ${instructionFiles.length} instruction files available.`);
|
|
57
|
+
const telemetryEvent = newInstructionsCollectionEvent();
|
|
58
|
+
const context = this._getContext(variables);
|
|
59
|
+
await this.addApplyingInstructions(instructionFiles, context, variables, telemetryEvent, token);
|
|
60
|
+
await this._addReferencedInstructions(variables, telemetryEvent, token);
|
|
61
|
+
await this._addAgentInstructions(variables, telemetryEvent, token);
|
|
62
|
+
const instructionsListVariable = await this._getInstructionsWithPatternsList(instructionFiles, variables, token);
|
|
63
|
+
if (instructionsListVariable) {
|
|
64
|
+
variables.add(instructionsListVariable);
|
|
65
|
+
telemetryEvent.listedInstructionsCount++;
|
|
66
|
+
}
|
|
67
|
+
this.sendTelemetry(telemetryEvent);
|
|
68
|
+
}
|
|
69
|
+
sendTelemetry(telemetryEvent) {
|
|
70
|
+
telemetryEvent.totalInstructionsCount = telemetryEvent.agentInstructionsCount + telemetryEvent.referencedInstructionsCount + telemetryEvent.applyingInstructionsCount + telemetryEvent.listedInstructionsCount;
|
|
71
|
+
this._telemetryService.publicLog2('instructionsCollected', telemetryEvent);
|
|
72
|
+
}
|
|
73
|
+
async addApplyingInstructions(instructionFiles, context, variables, telemetryEvent, token) {
|
|
74
|
+
for (const { uri } of instructionFiles) {
|
|
75
|
+
const parsedFile = await this._parseInstructionsFile(uri, token);
|
|
76
|
+
if (!parsedFile) {
|
|
77
|
+
this._logService.trace(`[InstructionsContextComputer] Unable to read: ${uri}`);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const applyTo = parsedFile.header?.applyTo;
|
|
81
|
+
if (!applyTo) {
|
|
82
|
+
this._logService.trace(`[InstructionsContextComputer] No 'applyTo' found: ${uri}`);
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
if (( context.instructions.has(uri))) {
|
|
86
|
+
this._logService.trace(`[InstructionsContextComputer] Skipping already processed instruction file: ${uri}`);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const match = this._matches(context.files, applyTo);
|
|
90
|
+
if (match) {
|
|
91
|
+
this._logService.trace(`[InstructionsContextComputer] Match for ${uri} with ${match.pattern}${match.file ? ` for file ${match.file}` : ''}`);
|
|
92
|
+
const reason = !match.file ?
|
|
93
|
+
( localize(5975, 'Automatically attached as pattern is **')) :
|
|
94
|
+
( localize(
|
|
95
|
+
5976,
|
|
96
|
+
'Automatically attached as pattern {0} matches {1}',
|
|
97
|
+
applyTo,
|
|
98
|
+
this._labelService.getUriLabel(match.file, { relative: true })
|
|
99
|
+
));
|
|
100
|
+
variables.add(toPromptFileVariableEntry(uri, PromptFileVariableKind.Instruction, reason, true));
|
|
101
|
+
telemetryEvent.applyingInstructionsCount++;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this._logService.trace(`[InstructionsContextComputer] No match for ${uri} with ${applyTo}`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
_getContext(attachedContext) {
|
|
109
|
+
const files = ( new ResourceSet());
|
|
110
|
+
const instructions = ( new ResourceSet());
|
|
111
|
+
for (const variable of attachedContext.asArray()) {
|
|
112
|
+
if (isPromptFileVariableEntry(variable)) {
|
|
113
|
+
instructions.add(variable.value);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const uri = IChatRequestVariableEntry.toUri(variable);
|
|
117
|
+
if (uri) {
|
|
118
|
+
files.add(uri);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { files, instructions };
|
|
123
|
+
}
|
|
124
|
+
async _addAgentInstructions(variables, telemetryEvent, token) {
|
|
125
|
+
const useCopilotInstructionsFiles = this._configurationService.getValue(PromptsConfig.USE_COPILOT_INSTRUCTION_FILES);
|
|
126
|
+
const useAgentMd = this._configurationService.getValue(PromptsConfig.USE_AGENT_MD);
|
|
127
|
+
if (!useCopilotInstructionsFiles && !useAgentMd) {
|
|
128
|
+
this._logService.trace(`[InstructionsContextComputer] No agent instructions files added (settings disabled).`);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const entries = ( new ChatRequestVariableSet());
|
|
132
|
+
if (useCopilotInstructionsFiles) {
|
|
133
|
+
const files = await this._promptsService.listCopilotInstructionsMDs(token);
|
|
134
|
+
for (const file of files) {
|
|
135
|
+
entries.add(toPromptFileVariableEntry(file, PromptFileVariableKind.Instruction, ( localize(
|
|
136
|
+
5977,
|
|
137
|
+
'Automatically attached as setting {0} is enabled',
|
|
138
|
+
PromptsConfig.USE_COPILOT_INSTRUCTION_FILES
|
|
139
|
+
)), true));
|
|
140
|
+
telemetryEvent.agentInstructionsCount++;
|
|
141
|
+
this._logService.trace(`[InstructionsContextComputer] copilot-instruction.md files added: ${( file.toString())}`);
|
|
142
|
+
}
|
|
143
|
+
await this._addReferencedInstructions(entries, telemetryEvent, token);
|
|
144
|
+
}
|
|
145
|
+
if (useAgentMd) {
|
|
146
|
+
const files = await this._promptsService.listAgentMDs(token, false);
|
|
147
|
+
for (const file of files) {
|
|
148
|
+
entries.add(toPromptFileVariableEntry(file, PromptFileVariableKind.Instruction, ( localize(
|
|
149
|
+
5978,
|
|
150
|
+
'Automatically attached as setting {0} is enabled',
|
|
151
|
+
PromptsConfig.USE_AGENT_MD
|
|
152
|
+
)), true));
|
|
153
|
+
telemetryEvent.agentInstructionsCount++;
|
|
154
|
+
this._logService.trace(`[InstructionsContextComputer] AGENTS.md files added: ${( file.toString())}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
for (const entry of entries.asArray()) {
|
|
158
|
+
variables.add(entry);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_matches(files, applyToPattern) {
|
|
162
|
+
const patterns = splitGlobAware(applyToPattern, ',');
|
|
163
|
+
const patterMatches = (pattern) => {
|
|
164
|
+
pattern = pattern.trim();
|
|
165
|
+
if (pattern.length === 0) {
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
if (pattern === '**' || pattern === '**/*' || pattern === '*') {
|
|
169
|
+
return { pattern };
|
|
170
|
+
}
|
|
171
|
+
if (!pattern.startsWith('/') && !pattern.startsWith('**/')) {
|
|
172
|
+
pattern = '**/' + pattern;
|
|
173
|
+
}
|
|
174
|
+
for (const file of files) {
|
|
175
|
+
if (match(pattern, file.path, { ignoreCase: true })) {
|
|
176
|
+
return { pattern, file };
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return undefined;
|
|
180
|
+
};
|
|
181
|
+
for (const pattern of patterns) {
|
|
182
|
+
const matchResult = patterMatches(pattern);
|
|
183
|
+
if (matchResult) {
|
|
184
|
+
return matchResult;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
189
|
+
_getTool(referenceName) {
|
|
190
|
+
if (!this._enabledTools) {
|
|
191
|
+
return undefined;
|
|
192
|
+
}
|
|
193
|
+
const tool = this._languageModelToolsService.getToolByName(referenceName);
|
|
194
|
+
if (tool && this._enabledTools.get(tool)) {
|
|
195
|
+
return { tool, variable: `#tool:${this._languageModelToolsService.getFullReferenceName(tool)}` };
|
|
196
|
+
}
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
async _getInstructionsWithPatternsList(instructionFiles, _existingVariables, token) {
|
|
200
|
+
const readTool = this._getTool('readFile');
|
|
201
|
+
const runSubagentTool = this._getTool(VSCodeToolReference.runSubagent);
|
|
202
|
+
const entries = [];
|
|
203
|
+
if (readTool) {
|
|
204
|
+
const searchNestedAgentMd = this._configurationService.getValue(PromptsConfig.USE_NESTED_AGENT_MD);
|
|
205
|
+
const agentsMdPromise = searchNestedAgentMd ? this._promptsService.findAgentMDsInWorkspace(token) : Promise.resolve([]);
|
|
206
|
+
entries.push('<instructions>');
|
|
207
|
+
entries.push('Here is a list of instruction files that contain rules for modifying or creating new code.');
|
|
208
|
+
entries.push('These files are important for ensuring that the code is modified or created correctly.');
|
|
209
|
+
entries.push('Please make sure to follow the rules specified in these files when working with the codebase.');
|
|
210
|
+
entries.push(`If the file is not already available as attachment, use the ${readTool.variable} tool to acquire it.`);
|
|
211
|
+
entries.push('Make sure to acquire the instructions before making any changes to the code.');
|
|
212
|
+
let hasContent = false;
|
|
213
|
+
for (const { uri } of instructionFiles) {
|
|
214
|
+
const parsedFile = await this._parseInstructionsFile(uri, token);
|
|
215
|
+
if (parsedFile) {
|
|
216
|
+
entries.push('<instruction>');
|
|
217
|
+
if (parsedFile.header) {
|
|
218
|
+
const { description, applyTo } = parsedFile.header;
|
|
219
|
+
if (description) {
|
|
220
|
+
entries.push(`<description>${description}</description>`);
|
|
221
|
+
}
|
|
222
|
+
entries.push(`<file>${getFilePath(uri)}</file>`);
|
|
223
|
+
if (applyTo) {
|
|
224
|
+
entries.push(`<applyTo>${applyTo}</applyTo>`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
entries.push('</instruction>');
|
|
228
|
+
hasContent = true;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const agentsMdFiles = await agentsMdPromise;
|
|
232
|
+
for (const uri of agentsMdFiles) {
|
|
233
|
+
if (uri) {
|
|
234
|
+
const folderName = this._labelService.getUriLabel(dirname(uri), { relative: true });
|
|
235
|
+
const description = folderName.trim().length === 0 ? ( localize(5979, 'Instructions for the workspace')) : ( localize(5980, 'Instructions for folder \'{0}\'', folderName));
|
|
236
|
+
entries.push('<instruction>');
|
|
237
|
+
entries.push(`<description>${description}</description>`);
|
|
238
|
+
entries.push(`<file>${getFilePath(uri)}</file>`);
|
|
239
|
+
entries.push('</instruction>');
|
|
240
|
+
hasContent = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (!hasContent) {
|
|
244
|
+
entries.length = 0;
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
entries.push('</instructions>', '', '');
|
|
248
|
+
}
|
|
249
|
+
const claudeSkills = await this._promptsService.findClaudeSkills(token);
|
|
250
|
+
if (claudeSkills && claudeSkills.length > 0) {
|
|
251
|
+
entries.push('<skills>');
|
|
252
|
+
entries.push('Here is a list of skills that contain domain specific knowledge on a variety of topics.');
|
|
253
|
+
entries.push('Each skill comes with a description of the topic and a file path that contains the detailed instructions.');
|
|
254
|
+
entries.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${readTool.variable} tool to acquire the full instructions from the file URI.`);
|
|
255
|
+
for (const skill of claudeSkills) {
|
|
256
|
+
entries.push('<skill>');
|
|
257
|
+
entries.push(`<name>${skill.name}</name>`);
|
|
258
|
+
if (skill.description) {
|
|
259
|
+
entries.push(`<description>${skill.description}</description>`);
|
|
260
|
+
}
|
|
261
|
+
entries.push(`<file>${getFilePath(skill.uri)}</file>`);
|
|
262
|
+
entries.push('</skill>');
|
|
263
|
+
}
|
|
264
|
+
entries.push('</skills>', '', '');
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
if (runSubagentTool) {
|
|
268
|
+
const subagentToolCustomAgents = this._configurationService.getValue(ChatConfiguration.SubagentToolCustomAgents);
|
|
269
|
+
if (subagentToolCustomAgents) {
|
|
270
|
+
const agents = await this._promptsService.getCustomAgents(token);
|
|
271
|
+
if (agents.length > 0) {
|
|
272
|
+
entries.push('<agents>');
|
|
273
|
+
entries.push('Here is a list of agents that can be used when running a subagent.');
|
|
274
|
+
entries.push('Each agent has optionally a description with the agent\'s purpose and expertise. When asked to run a subagent, choose the most appropriate agent from this list.');
|
|
275
|
+
entries.push(`Use the ${runSubagentTool.variable} tool with the agent name to run the subagent.`);
|
|
276
|
+
for (const agent of agents) {
|
|
277
|
+
if (agent.infer === false) {
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
entries.push('<agent>');
|
|
281
|
+
entries.push(`<name>${agent.name}</name>`);
|
|
282
|
+
if (agent.description) {
|
|
283
|
+
entries.push(`<description>${agent.description}</description>`);
|
|
284
|
+
}
|
|
285
|
+
if (agent.argumentHint) {
|
|
286
|
+
entries.push(`<argumentHint>${agent.argumentHint}</argumentHint>`);
|
|
287
|
+
}
|
|
288
|
+
entries.push('</agent>');
|
|
289
|
+
}
|
|
290
|
+
entries.push('</agents>', '', '');
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (entries.length === 0) {
|
|
295
|
+
return undefined;
|
|
296
|
+
}
|
|
297
|
+
const content = entries.join('\n');
|
|
298
|
+
const toolReferences = [];
|
|
299
|
+
const collectToolReference = (tool) => {
|
|
300
|
+
if (tool) {
|
|
301
|
+
let offset = content.indexOf(tool.variable);
|
|
302
|
+
while (offset >= 0) {
|
|
303
|
+
toolReferences.push(toToolVariableEntry(tool.tool, ( new OffsetRange(offset, offset + tool.variable.length))));
|
|
304
|
+
offset = content.indexOf(tool.variable, offset + 1);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
collectToolReference(readTool);
|
|
309
|
+
collectToolReference(runSubagentTool);
|
|
310
|
+
return toPromptTextVariableEntry(content, true, toolReferences);
|
|
311
|
+
}
|
|
312
|
+
async _addReferencedInstructions(attachedContext, telemetryEvent, token) {
|
|
313
|
+
const seen = ( new ResourceSet());
|
|
314
|
+
const todo = [];
|
|
315
|
+
for (const variable of attachedContext.asArray()) {
|
|
316
|
+
if (isPromptFileVariableEntry(variable)) {
|
|
317
|
+
if (!( seen.has(variable.value))) {
|
|
318
|
+
todo.push(variable.value);
|
|
319
|
+
seen.add(variable.value);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
let next = todo.pop();
|
|
324
|
+
while (next) {
|
|
325
|
+
const result = await this._parseInstructionsFile(next, token);
|
|
326
|
+
if (result && result.body) {
|
|
327
|
+
const refsToCheck = [];
|
|
328
|
+
for (const ref of result.body.fileReferences) {
|
|
329
|
+
const url = result.body.resolveFilePath(ref.content);
|
|
330
|
+
if (url && !( seen.has(url)) && (isPromptOrInstructionsFile(url) || this._workspaceService.getWorkspaceFolder(url) !== undefined)) {
|
|
331
|
+
refsToCheck.push({ resource: url });
|
|
332
|
+
seen.add(url);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (refsToCheck.length > 0) {
|
|
336
|
+
const stats = await this._fileService.resolveAll(refsToCheck);
|
|
337
|
+
for (let i = 0; i < stats.length; i++) {
|
|
338
|
+
const stat = stats[i];
|
|
339
|
+
const uri = refsToCheck[i].resource;
|
|
340
|
+
if (stat.success && stat.stat?.isFile) {
|
|
341
|
+
if (isPromptOrInstructionsFile(uri)) {
|
|
342
|
+
todo.push(uri);
|
|
343
|
+
}
|
|
344
|
+
const reason = ( localize(5981, 'Referenced by {0}', basename(next)));
|
|
345
|
+
attachedContext.add(toPromptFileVariableEntry(uri, PromptFileVariableKind.InstructionReference, reason, true));
|
|
346
|
+
telemetryEvent.referencedInstructionsCount++;
|
|
347
|
+
this._logService.trace(`[InstructionsContextComputer] ${( uri.toString())} added, referenced by ${( next.toString())}`);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
next = todo.pop();
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
};
|
|
356
|
+
ComputeAutomaticInstructions = ( __decorate([
|
|
357
|
+
( __param(1, IPromptsService)),
|
|
358
|
+
( __param(2, ILogService)),
|
|
359
|
+
( __param(3, ILabelService)),
|
|
360
|
+
( __param(4, IConfigurationService)),
|
|
361
|
+
( __param(5, IWorkspaceContextService)),
|
|
362
|
+
( __param(6, IFileService)),
|
|
363
|
+
( __param(7, ITelemetryService)),
|
|
364
|
+
( __param(8, ILanguageModelToolsService))
|
|
365
|
+
], ComputeAutomaticInstructions));
|
|
366
|
+
function getFilePath(uri) {
|
|
367
|
+
if (uri.scheme === Schemas.file || uri.scheme === Schemas.vscodeRemote) {
|
|
368
|
+
return uri.fsPath;
|
|
369
|
+
}
|
|
370
|
+
return ( uri.toString());
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export { ComputeAutomaticInstructions, newInstructionsCollectionEvent };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Emitter } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
|
|
5
|
+
import { ICodeEditorService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service";
|
|
6
|
+
import { IPosition, Position } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position";
|
|
7
|
+
import { IRange } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range";
|
|
8
|
+
import { ISelection } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/core/selection";
|
|
9
|
+
import { IEditorContribution } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/editorCommon";
|
|
10
|
+
import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
|
|
11
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
12
|
+
import { IMarkerDecorationsService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/markerDecorations.service";
|
|
13
|
+
import { EditSuggestionId } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/textModelEditSource";
|
|
14
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
15
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
16
|
+
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
17
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
18
|
+
import { IInstantiationService, ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
19
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
20
|
+
import { ISharedWebContentExtractorService } from "@codingame/monaco-vscode-api/vscode/vs/platform/webContentExtractor/common/webContentExtractor.service";
|
|
21
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
22
|
+
import { IChatAttachmentResolveService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.service";
|
|
23
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
24
|
+
import { IChatRequestVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariableEntries";
|
|
25
|
+
import { ILanguageModelChatSelector } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels";
|
|
26
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
27
|
+
import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
28
|
+
import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
29
|
+
import { HunkInformation, Session } from "./inlineChatSession.js";
|
|
30
|
+
import { IInlineChatSessionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service";
|
|
31
|
+
import { EditorBasedInlineChatWidget } from "./inlineChatWidget.js";
|
|
32
|
+
export declare enum State {
|
|
33
|
+
CREATE_SESSION = "CREATE_SESSION",
|
|
34
|
+
INIT_UI = "INIT_UI",
|
|
35
|
+
WAIT_FOR_INPUT = "WAIT_FOR_INPUT",
|
|
36
|
+
SHOW_REQUEST = "SHOW_REQUEST",
|
|
37
|
+
PAUSE = "PAUSE",
|
|
38
|
+
CANCEL = "CANCEL",
|
|
39
|
+
ACCEPT = "DONE"
|
|
40
|
+
}
|
|
41
|
+
export declare abstract class InlineChatRunOptions {
|
|
42
|
+
initialSelection?: ISelection;
|
|
43
|
+
initialRange?: IRange;
|
|
44
|
+
message?: string;
|
|
45
|
+
attachments?: URI[];
|
|
46
|
+
autoSend?: boolean;
|
|
47
|
+
existingSession?: Session;
|
|
48
|
+
position?: IPosition;
|
|
49
|
+
modelSelector?: ILanguageModelChatSelector;
|
|
50
|
+
blockOnResponse?: boolean;
|
|
51
|
+
static isInlineChatRunOptions(options: unknown): options is InlineChatRunOptions;
|
|
52
|
+
}
|
|
53
|
+
export declare class InlineChatController implements IEditorContribution {
|
|
54
|
+
private readonly _notebookEditorService;
|
|
55
|
+
static ID: string;
|
|
56
|
+
static get(editor: ICodeEditor): InlineChatController | null;
|
|
57
|
+
private readonly _delegate;
|
|
58
|
+
constructor(editor: ICodeEditor, configurationService: IConfigurationService, _notebookEditorService: INotebookEditorService);
|
|
59
|
+
dispose(): void;
|
|
60
|
+
get isActive(): boolean;
|
|
61
|
+
run(arg?: InlineChatRunOptions): Promise<boolean>;
|
|
62
|
+
focus(): void;
|
|
63
|
+
get widget(): EditorBasedInlineChatWidget;
|
|
64
|
+
getWidgetPosition(): Position | undefined;
|
|
65
|
+
acceptSession(): void | Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated
|
|
69
|
+
*/
|
|
70
|
+
export declare class InlineChatController1 implements IEditorContribution {
|
|
71
|
+
private readonly _editor;
|
|
72
|
+
private readonly _instaService;
|
|
73
|
+
private readonly _inlineChatSessionService;
|
|
74
|
+
private readonly _editorWorkerService;
|
|
75
|
+
private readonly _logService;
|
|
76
|
+
private readonly _configurationService;
|
|
77
|
+
private readonly _dialogService;
|
|
78
|
+
private readonly _chatService;
|
|
79
|
+
private readonly _editorService;
|
|
80
|
+
private readonly _webContentExtractorService;
|
|
81
|
+
private readonly _fileService;
|
|
82
|
+
private readonly _chatAttachmentResolveService;
|
|
83
|
+
static get(editor: ICodeEditor): InlineChatController1 | null;
|
|
84
|
+
private _isDisposed;
|
|
85
|
+
private readonly _store;
|
|
86
|
+
private readonly _ui;
|
|
87
|
+
private readonly _ctxVisible;
|
|
88
|
+
private readonly _ctxEditing;
|
|
89
|
+
private readonly _ctxResponseType;
|
|
90
|
+
private readonly _ctxRequestInProgress;
|
|
91
|
+
private readonly _ctxResponse;
|
|
92
|
+
private readonly _messages;
|
|
93
|
+
protected readonly _onDidEnterState: Emitter<State>;
|
|
94
|
+
get chatWidget(): import("../../chat/browser/chatWidget.js").ChatWidget;
|
|
95
|
+
private readonly _sessionStore;
|
|
96
|
+
private readonly _stashedSession;
|
|
97
|
+
private _delegateSession?;
|
|
98
|
+
private _session?;
|
|
99
|
+
private _strategy?;
|
|
100
|
+
constructor(_editor: ICodeEditor, _instaService: IInstantiationService, _inlineChatSessionService: IInlineChatSessionService, _editorWorkerService: IEditorWorkerService, _logService: ILogService, _configurationService: IConfigurationService, _dialogService: IDialogService, contextKeyService: IContextKeyService, _chatService: IChatService, _editorService: IEditorService, notebookEditorService: INotebookEditorService, _webContentExtractorService: ISharedWebContentExtractorService, _fileService: IFileService, _chatAttachmentResolveService: IChatAttachmentResolveService);
|
|
101
|
+
dispose(): void;
|
|
102
|
+
private _log;
|
|
103
|
+
get widget(): EditorBasedInlineChatWidget;
|
|
104
|
+
getId(): string;
|
|
105
|
+
getWidgetPosition(): Position | undefined;
|
|
106
|
+
private _currentRun?;
|
|
107
|
+
run(options?: InlineChatRunOptions | undefined): Promise<boolean>;
|
|
108
|
+
protected _nextState(state: State, options: InlineChatRunOptions): Promise<void>;
|
|
109
|
+
private [State.CREATE_SESSION];
|
|
110
|
+
private [State.INIT_UI];
|
|
111
|
+
private [State.WAIT_FOR_INPUT];
|
|
112
|
+
private [State.SHOW_REQUEST];
|
|
113
|
+
private [State.PAUSE];
|
|
114
|
+
private [State.ACCEPT];
|
|
115
|
+
private [State.CANCEL];
|
|
116
|
+
private _showWidget;
|
|
117
|
+
private _resetWidget;
|
|
118
|
+
private _updateCtxResponseType;
|
|
119
|
+
private _createChatTextEditGroupState;
|
|
120
|
+
private _makeChanges;
|
|
121
|
+
private _getMetadata;
|
|
122
|
+
private _updatePlaceholder;
|
|
123
|
+
private _updateInput;
|
|
124
|
+
arrowOut(up: boolean): void;
|
|
125
|
+
focus(): void;
|
|
126
|
+
viewInChat(): Promise<void>;
|
|
127
|
+
acceptSession(): void;
|
|
128
|
+
acceptHunk(hunkInfo?: HunkInformation): void | undefined;
|
|
129
|
+
discardHunk(hunkInfo?: HunkInformation): void | undefined;
|
|
130
|
+
toggleDiff(hunkInfo?: HunkInformation): void | undefined;
|
|
131
|
+
moveHunk(next: boolean): void;
|
|
132
|
+
cancelSession(): Promise<void>;
|
|
133
|
+
reportIssue(): void;
|
|
134
|
+
unstashLastSession(): Session | undefined;
|
|
135
|
+
joinCurrentRun(): Promise<void> | undefined;
|
|
136
|
+
get isActive(): boolean;
|
|
137
|
+
createImageAttachment(attachment: URI): Promise<IChatRequestVariableEntry | undefined>;
|
|
138
|
+
}
|
|
139
|
+
export declare class InlineChatController2 implements IEditorContribution {
|
|
140
|
+
private readonly _editor;
|
|
141
|
+
private readonly _instaService;
|
|
142
|
+
private readonly _notebookEditorService;
|
|
143
|
+
private readonly _inlineChatSessionService;
|
|
144
|
+
private readonly _webContentExtractorService;
|
|
145
|
+
private readonly _fileService;
|
|
146
|
+
private readonly _chatAttachmentResolveService;
|
|
147
|
+
private readonly _editorService;
|
|
148
|
+
private readonly _markerDecorationsService;
|
|
149
|
+
private readonly _languageModelService;
|
|
150
|
+
static readonly ID = "editor.contrib.inlineChatController2";
|
|
151
|
+
static get(editor: ICodeEditor): InlineChatController2 | undefined;
|
|
152
|
+
private readonly _store;
|
|
153
|
+
private readonly _isActiveController;
|
|
154
|
+
private readonly _zone;
|
|
155
|
+
private readonly _currentSession;
|
|
156
|
+
get widget(): EditorBasedInlineChatWidget;
|
|
157
|
+
get isActive(): boolean;
|
|
158
|
+
constructor(_editor: ICodeEditor, _instaService: IInstantiationService, _notebookEditorService: INotebookEditorService, _inlineChatSessionService: IInlineChatSessionService, codeEditorService: ICodeEditorService, contextKeyService: IContextKeyService, _webContentExtractorService: ISharedWebContentExtractorService, _fileService: IFileService, _chatAttachmentResolveService: IChatAttachmentResolveService, _editorService: IEditorService, _markerDecorationsService: IMarkerDecorationsService, _languageModelService: ILanguageModelsService, chatService: IChatService);
|
|
159
|
+
dispose(): void;
|
|
160
|
+
getWidgetPosition(): Position | undefined;
|
|
161
|
+
focus(): void;
|
|
162
|
+
run(arg?: InlineChatRunOptions): Promise<boolean>;
|
|
163
|
+
acceptSession(): Promise<void>;
|
|
164
|
+
rejectSession(): Promise<void>;
|
|
165
|
+
createImageAttachment(attachment: URI): Promise<IChatRequestVariableEntry | undefined>;
|
|
166
|
+
}
|
|
167
|
+
export declare function reviewEdits(accessor: ServicesAccessor, editor: ICodeEditor, stream: AsyncIterable<TextEdit[]>, token: CancellationToken, applyCodeBlockSuggestionId: EditSuggestionId | undefined): Promise<boolean>;
|
|
168
|
+
export declare function reviewNotebookEdits(accessor: ServicesAccessor, uri: URI, stream: AsyncIterable<[
|
|
169
|
+
URI,
|
|
170
|
+
TextEdit[]
|
|
171
|
+
] | ICellEditOperation[]>, token: CancellationToken): Promise<boolean>;
|