@codingame/monaco-vscode-katex-common 31.0.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +15 -3
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +6 -5
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +5 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +45 -14
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +15 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +51 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +45 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +46 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +155 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +37 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +250 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +14 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +7 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +51 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +56 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/buffers/paragraphBuffer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatIncrementalRendering/chatIncrementalRendering.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +68 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.d.ts +58 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +653 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +28 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +91 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +53 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +42 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +93 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +169 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +60 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +13 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +15 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +125 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +29 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +119 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +132 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +156 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +133 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +53 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +288 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +23 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +699 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +12 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatPhoneInputPresenter.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +9 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +89 -108
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +521 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +19 -19
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionStorageKeys.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +44 -17
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +3 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.d.ts → inlineChatAffordanceWidget.d.ts} +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/{inlineChatEditorAffordance.js → inlineChatAffordanceWidget.js} +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +19 -400
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -9
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +5 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +47 -133
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +103 -25
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +3 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -92
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +99 -32
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +76 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +89 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +11 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +7 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +11 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +59 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +24 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +111 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +60 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +455 -171
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +49 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +302 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +34 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +233 -48
- package/vscode/src/vs/platform/actions/browser/actionbar.d.ts +0 -16
- package/vscode/src/vs/platform/actions/browser/actionbar.js +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -539
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -386
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +0 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +0 -509
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +0 -276
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +0 -93
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +0 -617
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +0 -231
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { $ as $$1, clearNode, h, hide, append, addStandardDisposableListener, EventType, DisposableResizeObserver, setVisibility, isKeyboardEvent, getActiveElement, getWindow, show, addDisposableListener, getTotalWidth } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
3
|
+
import { $ as $$1, clearNode, h, hide, append, addStandardDisposableListener, EventType, isHTMLElement, DisposableResizeObserver, setVisibility, isKeyboardEvent, getActiveElement, getWindow, show, addDisposableListener, scheduleAtNextAnimationFrame, getTotalWidth } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { DEFAULT_FONT_FAMILY } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/fonts';
|
|
5
5
|
import { hasModifierKeys } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/keyboardEvent';
|
|
6
|
-
import {
|
|
6
|
+
import { ActionViewItem, BaseActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionViewItems';
|
|
7
7
|
import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
8
8
|
import { ButtonWithIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
9
9
|
import { createInstantHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
@@ -73,9 +73,8 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
73
73
|
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
74
74
|
import { AccessibilityCommandId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
|
|
75
75
|
import { getSimpleEditorOptions, getSimpleCodeEditorWidgetOptions, setupSimpleEditorSelectionStyling } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
76
|
-
import { InlineChatConfigKeys } from '../../../../inlineChat/common/inlineChat.js';
|
|
77
76
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
78
|
-
import { ChatRequestVariableSet, isImageVariableEntry, isStringVariableEntry, getImageAttachmentLimit, OmittedState, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
77
|
+
import { ChatRequestVariableSet, isImageVariableEntry, isStringVariableEntry, getImageAttachmentLimit, OmittedState, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry, isBrowserViewVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
79
78
|
import { getModeNameForTelemetry, ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
80
79
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
81
80
|
import { localChatSessionType, isIChatSessionFileChange2 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
@@ -90,18 +89,20 @@ import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
90
89
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
91
90
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
92
91
|
import { ChatHistoryNavigator } from '../../../common/widget/chatWidgetHistoryService.js';
|
|
93
|
-
import { ChatSubmitAction, OpenModePickerAction, OpenModelPickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction,
|
|
92
|
+
import { ChatSubmitAction, OpenModePickerAction, OpenModelPickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction, ChatSessionPrimaryPickerAction, OpenWorkspacePickerAction, OpenPermissionPickerAction } from '../../actions/chatExecuteActions.js';
|
|
94
93
|
import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
95
94
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
96
95
|
import { ChatAttachmentModel } from '../../attachments/chatAttachmentModel.js';
|
|
97
96
|
import { IChatAttachmentWidgetRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service';
|
|
98
|
-
import { ToolSetOrToolItemAttachmentWidget, NotebookCellOutputChatAttachmentWidget, PromptFileAttachmentWidget, PromptTextAttachmentWidget, FileAttachmentWidget, TerminalCommandAttachmentWidget, ImageAttachmentWidget, ElementChatAttachmentWidget, PasteAttachmentWidget, SCMHistoryItemAttachmentWidget, SCMHistoryItemChangeAttachmentWidget, SCMHistoryItemChangeRangeAttachmentWidget, DefaultChatAttachmentWidget } from '../../attachments/chatAttachmentWidgets.js';
|
|
97
|
+
import { ToolSetOrToolItemAttachmentWidget, NotebookCellOutputChatAttachmentWidget, PromptFileAttachmentWidget, PromptTextAttachmentWidget, FileAttachmentWidget, TerminalCommandAttachmentWidget, ImageAttachmentWidget, ElementChatAttachmentWidget, PasteAttachmentWidget, SCMHistoryItemAttachmentWidget, SCMHistoryItemChangeAttachmentWidget, SCMHistoryItemChangeRangeAttachmentWidget, BrowserViewAttachmentWidget, DefaultChatAttachmentWidget } from '../../attachments/chatAttachmentWidgets.js';
|
|
99
98
|
import { ChatImplicitContexts } from '../../attachments/chatImplicitContext.js';
|
|
100
99
|
import { ImplicitContextAttachmentWidget } from '../../attachments/implicitContextAttachment.js';
|
|
101
100
|
import { isIChatResourceViewContext, isIChatViewViewContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
102
101
|
import { ChatEditingShowChangesAction, ViewPreviousEditsAction } from '../../chatEditing/chatEditingActions.js';
|
|
103
102
|
import { resizeImage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatImageUtils';
|
|
104
103
|
import { ChatSessionPickerActionItem } from '../../chatSessions/chatSessionPickerActionItem.js';
|
|
104
|
+
import { MobileChatInputCombinedPickerActionItem } from './chatPhoneInputPresenter.js';
|
|
105
|
+
import { IChatPhoneInputPresenter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.service';
|
|
105
106
|
import { IChatContextService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service';
|
|
106
107
|
import { ChatPlanReviewPart } from '../chatContentParts/chatPlanReviewPart.js';
|
|
107
108
|
import { ChatQuestionCarouselPart } from '../chatContentParts/chatQuestionCarouselPart.js';
|
|
@@ -111,7 +112,8 @@ import { ChatTodoListWidget } from '../chatContentParts/chatTodoListWidget.js';
|
|
|
111
112
|
import { ChatArtifactsWidget } from '../chatArtifactsWidget.js';
|
|
112
113
|
import { ChatDragAndDrop } from '../chatDragAndDrop.js';
|
|
113
114
|
import { ChatFollowups } from './chatFollowups.js';
|
|
114
|
-
import {
|
|
115
|
+
import { IChatInputNotificationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service';
|
|
116
|
+
import { ChatInputNotificationWidget } from './chatInputNotificationWidget.js';
|
|
115
117
|
import { ChatSelectedTools } from './chatSelectedTools.js';
|
|
116
118
|
import { DelegationSessionPickerActionItem } from './delegationSessionPickerActionItem.js';
|
|
117
119
|
import { ModelPickerActionItem } from './modelPickerActionItem.js';
|
|
@@ -143,7 +145,8 @@ const INPUT_EDITOR_PADDING = {
|
|
|
143
145
|
}
|
|
144
146
|
};
|
|
145
147
|
const CachedLanguageModelsKey = "chat.cachedLanguageModels.v2";
|
|
146
|
-
const CHAT_INPUT_PICKER_COLLAPSE_WIDTH =
|
|
148
|
+
const CHAT_INPUT_PICKER_COLLAPSE_WIDTH = 480;
|
|
149
|
+
const PERMISSION_LEVEL_OPTION_ID = "permissionLevel";
|
|
147
150
|
var ChatWidgetLocation;
|
|
148
151
|
(function(ChatWidgetLocation) {
|
|
149
152
|
ChatWidgetLocation["SidebarLeft"] = "sidebarLeft";
|
|
@@ -223,6 +226,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
223
226
|
get currentModeObs() {
|
|
224
227
|
return this._currentModeObservable;
|
|
225
228
|
}
|
|
229
|
+
get currentChatModesObs() {
|
|
230
|
+
return this._currentChatModesObservable;
|
|
231
|
+
}
|
|
226
232
|
get currentPermissionLevelObs() {
|
|
227
233
|
return this._currentPermissionLevel;
|
|
228
234
|
}
|
|
@@ -294,7 +300,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
294
300
|
scmService,
|
|
295
301
|
layoutService,
|
|
296
302
|
viewDescriptorService,
|
|
297
|
-
_chatAttachmentWidgetRegistry
|
|
303
|
+
_chatAttachmentWidgetRegistry,
|
|
304
|
+
chatInputNotificationService,
|
|
305
|
+
chatPhoneInputPresenter
|
|
298
306
|
) {
|
|
299
307
|
super();
|
|
300
308
|
this.location = location;
|
|
@@ -326,6 +334,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
326
334
|
this.layoutService = layoutService;
|
|
327
335
|
this.viewDescriptorService = viewDescriptorService;
|
|
328
336
|
this._chatAttachmentWidgetRegistry = _chatAttachmentWidgetRegistry;
|
|
337
|
+
this.chatInputNotificationService = chatInputNotificationService;
|
|
338
|
+
this.chatPhoneInputPresenter = chatPhoneInputPresenter;
|
|
329
339
|
this._workingSetCollapsed = observableValue("chatInputPart.workingSetCollapsed", true);
|
|
330
340
|
this._stableInputPartWidth = observableValue("chatInputPart.stableInputPartWidth", 0);
|
|
331
341
|
this._chatInputTodoListWidget = this._register(( new MutableDisposable()));
|
|
@@ -362,7 +372,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
362
372
|
this.followupsDisposables = this._register(( new DisposableStore()));
|
|
363
373
|
this.overlayClickListener = this._register(( new MutableDisposable()));
|
|
364
374
|
this.attachedContextDisposables = this._register(( new MutableDisposable()));
|
|
365
|
-
this.
|
|
375
|
+
this._notificationWidget = this._register(( new MutableDisposable()));
|
|
366
376
|
this._contextUsageDisposables = this._register(( new MutableDisposable()));
|
|
367
377
|
this.height = observableValue(this, 0);
|
|
368
378
|
this._forceVisibleScrollbarUntilAccept = false;
|
|
@@ -393,6 +403,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
393
403
|
onDidChangeVisibility: this._onDidChangeVisibility.event
|
|
394
404
|
}));
|
|
395
405
|
this._currentModeObservable = observableValue("currentMode", this.options.defaultMode ?? ChatMode.Agent);
|
|
406
|
+
this._currentChatModesObservable = observableValue("currentChatModes", this.chatModeService.getModes(localChatSessionType));
|
|
396
407
|
this._currentPermissionLevel = observableValue("permissionLevel", this.getDefaultPermissionLevel());
|
|
397
408
|
this._register(this.editorService.onDidActiveEditorChange(() => {
|
|
398
409
|
this._indexOfLastOpenedContext = -1;
|
|
@@ -526,9 +537,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
526
537
|
ariaLabel: this._getAriaLabel()
|
|
527
538
|
});
|
|
528
539
|
}));
|
|
529
|
-
this._register(
|
|
530
|
-
|
|
531
|
-
|
|
540
|
+
this._register(autorun(reader => {
|
|
541
|
+
const modes = this._currentChatModesObservable.read(reader);
|
|
542
|
+
reader.store.add(modes.onDidChange(() => this.validateCurrentChatMode()));
|
|
543
|
+
}));
|
|
532
544
|
this._register(autorun(r => {
|
|
533
545
|
const mode = this._currentModeObservable.read(r);
|
|
534
546
|
this.chatModeKindKey.set(mode.kind);
|
|
@@ -632,11 +644,67 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
632
644
|
}
|
|
633
645
|
}
|
|
634
646
|
openModelPicker() {
|
|
647
|
+
if (this.chatPhoneInputPresenter.enabled.get()) {
|
|
648
|
+
this._showCombinedPhonePickerSheet();
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
635
651
|
this.modelWidget?.show();
|
|
636
652
|
}
|
|
637
653
|
openModePicker() {
|
|
654
|
+
if (this.chatPhoneInputPresenter.enabled.get()) {
|
|
655
|
+
this._showCombinedPhonePickerSheet();
|
|
656
|
+
return;
|
|
657
|
+
}
|
|
638
658
|
this.modeWidget?.show();
|
|
639
659
|
}
|
|
660
|
+
_showCombinedPhonePickerSheet() {
|
|
661
|
+
const target = this.inputActionsToolbar.getElement();
|
|
662
|
+
this.chatPhoneInputPresenter.showCombinedModeAndModelSheet(
|
|
663
|
+
target,
|
|
664
|
+
this._createModePickerDelegate(),
|
|
665
|
+
this._createModelPickerDelegate()
|
|
666
|
+
).catch(
|
|
667
|
+
err => this.logService.error("[ChatInputPart] phone picker sheet failed", err)
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
_createModelPickerDelegate() {
|
|
671
|
+
return {
|
|
672
|
+
currentModel: this._currentLanguageModel,
|
|
673
|
+
setModel: model => {
|
|
674
|
+
this._waitForPersistedLanguageModel.clear();
|
|
675
|
+
this.setCurrentLanguageModel(model);
|
|
676
|
+
this.renderAttachedContext();
|
|
677
|
+
},
|
|
678
|
+
getModels: () => this.getModels(),
|
|
679
|
+
useGroupedModelPicker: () => {
|
|
680
|
+
const sessionType = this.getCurrentSessionType();
|
|
681
|
+
return !sessionType || sessionType === localChatSessionType;
|
|
682
|
+
},
|
|
683
|
+
showManageModelsAction: () => {
|
|
684
|
+
const sessionType = this.getCurrentSessionType();
|
|
685
|
+
return !sessionType || sessionType === localChatSessionType;
|
|
686
|
+
},
|
|
687
|
+
showUnavailableFeatured: () => {
|
|
688
|
+
const sessionType = this.getCurrentSessionType();
|
|
689
|
+
return !sessionType || sessionType === localChatSessionType;
|
|
690
|
+
},
|
|
691
|
+
showFeatured: () => {
|
|
692
|
+
const sessionType = this.getCurrentSessionType();
|
|
693
|
+
return !sessionType || sessionType === localChatSessionType;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
_createModePickerDelegate() {
|
|
698
|
+
return {
|
|
699
|
+
currentMode: this._currentModeObservable,
|
|
700
|
+
currentChatModes: this._currentChatModesObservable,
|
|
701
|
+
sessionResource: () => this._widget?.viewModel?.sessionResource,
|
|
702
|
+
customAgentTarget: () => {
|
|
703
|
+
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
704
|
+
return (sessionResource && this.chatSessionsService.getCustomAgentTargetForSessionType(getChatSessionType(sessionResource))) ?? Target.Undefined;
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
}
|
|
640
708
|
openPermissionPicker() {
|
|
641
709
|
this.permissionWidget?.show();
|
|
642
710
|
}
|
|
@@ -645,6 +713,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
645
713
|
this._currentPermissionLevel.set(level, undefined);
|
|
646
714
|
this.permissionLevelKey.set(level);
|
|
647
715
|
this.permissionWidget?.refresh();
|
|
716
|
+
const sessionResource = this.getCurrentSessionResource();
|
|
717
|
+
if (sessionResource) {
|
|
718
|
+
this.chatSessionsService.setSessionOption(sessionResource, PERMISSION_LEVEL_OPTION_ID, level);
|
|
719
|
+
}
|
|
648
720
|
this._syncInputStateToModel();
|
|
649
721
|
}
|
|
650
722
|
getDefaultPermissionLevel() {
|
|
@@ -719,12 +791,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
719
791
|
}
|
|
720
792
|
return widgets;
|
|
721
793
|
}
|
|
722
|
-
setInputModel(model, chatSessionIsEmpty) {
|
|
794
|
+
setInputModel(model, chatSessionIsEmpty, forSessionResource) {
|
|
723
795
|
if (this._inputModel) {
|
|
724
796
|
this._syncInputStateToModel();
|
|
725
797
|
}
|
|
726
798
|
this._inputModel = model;
|
|
727
799
|
this._modelSyncDisposables.clear();
|
|
800
|
+
this._currentChatModesObservable.set(
|
|
801
|
+
this.chatModeService.getModes(getChatSessionType(forSessionResource)),
|
|
802
|
+
undefined
|
|
803
|
+
);
|
|
728
804
|
this.selectedToolsModel.resetSessionEnablementState();
|
|
729
805
|
this._chatSessionIsEmpty = chatSessionIsEmpty;
|
|
730
806
|
if (chatSessionIsEmpty) {
|
|
@@ -734,7 +810,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
734
810
|
this._setEmptyModelState();
|
|
735
811
|
}
|
|
736
812
|
}));
|
|
737
|
-
this._modelSyncDisposables.add(this.
|
|
813
|
+
this._modelSyncDisposables.add(this._currentChatModesObservable.get().onDidChange(() => {
|
|
738
814
|
if (this._chatSessionIsEmpty) {
|
|
739
815
|
this._setEmptyModelState();
|
|
740
816
|
}
|
|
@@ -745,11 +821,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
745
821
|
if (!state && this._chatSessionIsEmpty) {
|
|
746
822
|
state = this._emptyInputState.read(undefined);
|
|
747
823
|
}
|
|
748
|
-
this._syncFromModel(state);
|
|
824
|
+
this._syncFromModel(state, forSessionResource);
|
|
749
825
|
}));
|
|
750
826
|
}
|
|
751
827
|
_setEmptyModelState() {
|
|
752
|
-
this.
|
|
828
|
+
if (this._inputModel?.state?.get()?.permissionLevel !== this.getDefaultPermissionLevel()) {
|
|
829
|
+
this.setPermissionLevel(this.getDefaultPermissionLevel());
|
|
830
|
+
}
|
|
753
831
|
if (this.entitlementService.anonymous) {
|
|
754
832
|
this.setChatMode(ChatModeKind.Agent, false);
|
|
755
833
|
this.checkModelSupported();
|
|
@@ -760,7 +838,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
760
838
|
const defaultMode = rawDefaultMode.trim();
|
|
761
839
|
if (defaultMode) {
|
|
762
840
|
const defaultModeLower = defaultMode.toLowerCase();
|
|
763
|
-
const
|
|
841
|
+
const modes = this._currentChatModesObservable.get();
|
|
842
|
+
const resolved = modes.findModeById(defaultMode) ?? modes.findModeByName(defaultMode) ?? modes.custom.find(m => m.name.get().toLowerCase() === defaultModeLower);
|
|
764
843
|
if (resolved) {
|
|
765
844
|
this.logService.trace(
|
|
766
845
|
`[ChatInputPart] Applying default mode from setting: ${defaultMode} -> ${resolved.id}`
|
|
@@ -771,7 +850,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
771
850
|
}
|
|
772
851
|
}
|
|
773
852
|
}
|
|
774
|
-
_syncFromModel(state) {
|
|
853
|
+
_syncFromModel(state, forSessionResource) {
|
|
775
854
|
if (this._isSyncingToOrFromInputModel) {
|
|
776
855
|
return;
|
|
777
856
|
}
|
|
@@ -785,7 +864,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
785
864
|
}
|
|
786
865
|
if (state?.selectedModel) {
|
|
787
866
|
const allModels = this.getAllMergedModels();
|
|
788
|
-
const sessionType = this.getCurrentSessionType();
|
|
867
|
+
const sessionType = this.getCurrentSessionType() ?? getChatSessionType(forSessionResource);
|
|
789
868
|
const syncResult = resolveModelFromSyncState(
|
|
790
869
|
state.selectedModel,
|
|
791
870
|
this._currentLanguageModel.get(),
|
|
@@ -794,7 +873,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
794
873
|
{
|
|
795
874
|
location: this.location,
|
|
796
875
|
currentModeKind: this.currentModeKind,
|
|
797
|
-
isInlineChatV2Enabled: !!this.configurationService.getValue(InlineChatConfigKeys.EnableV2),
|
|
798
876
|
sessionType
|
|
799
877
|
}
|
|
800
878
|
);
|
|
@@ -846,6 +924,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
846
924
|
this._isSyncingToOrFromInputModel = false;
|
|
847
925
|
queueMicrotask(() => this.inputActionsToolbar?.relayout());
|
|
848
926
|
}
|
|
927
|
+
flushInputStateToModel() {
|
|
928
|
+
if (this._inputModel) {
|
|
929
|
+
this._syncInputStateToModel();
|
|
930
|
+
}
|
|
931
|
+
}
|
|
849
932
|
setCurrentLanguageModel(model) {
|
|
850
933
|
this._currentLanguageModel.set(model, undefined);
|
|
851
934
|
if (this.cachedWidth) {
|
|
@@ -871,7 +954,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
871
954
|
if (shouldResetModelToDefault(lm, this.getModels(), {
|
|
872
955
|
location: this.location,
|
|
873
956
|
currentModeKind: this.currentModeKind,
|
|
874
|
-
isInlineChatV2Enabled: !!this.configurationService.getValue(InlineChatConfigKeys.EnableV2),
|
|
875
957
|
sessionType: this.getCurrentSessionType()
|
|
876
958
|
}, allModels)) {
|
|
877
959
|
this.setCurrentLanguageModelToDefault();
|
|
@@ -881,7 +963,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
881
963
|
if (!this.options.supportsChangingModes) {
|
|
882
964
|
return;
|
|
883
965
|
}
|
|
884
|
-
const
|
|
966
|
+
const modes = this._currentChatModesObservable.get();
|
|
967
|
+
const mode2 = modes.findModeById(mode) ?? modes.findModeByName(mode) ?? modes.findModeById(ChatModeKind.Agent) ?? ChatMode.Ask;
|
|
885
968
|
this.setChatMode2(mode2, storeSelection);
|
|
886
969
|
}
|
|
887
970
|
setChatMode2(mode, storeSelection = true) {
|
|
@@ -899,8 +982,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
899
982
|
metadata: this.languageModelsService.lookupLanguageModel(modelId)
|
|
900
983
|
})));
|
|
901
984
|
const contributedVendors = ( new Set(( this.languageModelsService.getVendors().map(v => v.vendor))));
|
|
902
|
-
const
|
|
903
|
-
|
|
985
|
+
const resolvedVendors = ( new Set());
|
|
986
|
+
for (const v of contributedVendors) {
|
|
987
|
+
if (this.languageModelsService.hasResolvedVendor(v)) {
|
|
988
|
+
resolvedVendors.add(v);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
const models = mergeModelsWithCache(liveModels, cachedModels, contributedVendors, resolvedVendors);
|
|
992
|
+
if (liveModels.length > 0 || resolvedVendors.size > 0) {
|
|
904
993
|
this.storageService.store(
|
|
905
994
|
CachedLanguageModelsKey,
|
|
906
995
|
models,
|
|
@@ -913,13 +1002,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
913
1002
|
getModels() {
|
|
914
1003
|
const models = this.getAllMergedModels();
|
|
915
1004
|
models.sort((a, b) => a.metadata.name.localeCompare(b.metadata.name));
|
|
916
|
-
return filterModelsForSession(
|
|
917
|
-
models,
|
|
918
|
-
this.getCurrentSessionType(),
|
|
919
|
-
this.currentModeKind,
|
|
920
|
-
this.location,
|
|
921
|
-
!!this.configurationService.getValue(InlineChatConfigKeys.EnableV2)
|
|
922
|
-
);
|
|
1005
|
+
return filterModelsForSession(models, this.getCurrentSessionType(), this.currentModeKind, this.location);
|
|
923
1006
|
}
|
|
924
1007
|
getCurrentSessionType() {
|
|
925
1008
|
const delegateSessionType = this.options.sessionTypePickerDelegate?.getActiveSessionProvider?.();
|
|
@@ -981,6 +1064,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
981
1064
|
}
|
|
982
1065
|
const tryMatch = () => {
|
|
983
1066
|
const models = this.getModels();
|
|
1067
|
+
if (models.length === 0) {
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
1070
|
+
if (models.length === 1 && models[0].metadata.id.toLocaleLowerCase() === "auto") {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
984
1073
|
let match = models.find(m => m.identifier === lastModelId);
|
|
985
1074
|
if (!match) {
|
|
986
1075
|
match = models.find(m => m.metadata.id === lastModelId);
|
|
@@ -1034,45 +1123,45 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1034
1123
|
}
|
|
1035
1124
|
const mode = this._currentModeObservable.get();
|
|
1036
1125
|
const modelName = this._currentLanguageModel.get()?.metadata.name;
|
|
1037
|
-
const modelInfo = modelName ? ( localize(
|
|
1126
|
+
const modelInfo = modelName ? ( localize(7445, ", {0}. ", modelName)) : "";
|
|
1038
1127
|
let modeLabel = "";
|
|
1039
1128
|
if (!mode.isBuiltin) {
|
|
1040
1129
|
const mode = this.currentModeObs.get();
|
|
1041
|
-
modeLabel = ( localize(
|
|
1130
|
+
modeLabel = ( localize(7446, "({0}), {1}", mode.label.get(), mode.description.get()));
|
|
1042
1131
|
} else {
|
|
1043
1132
|
switch (this.currentModeKind) {
|
|
1044
1133
|
case ChatModeKind.Agent:
|
|
1045
|
-
modeLabel = ( localize(
|
|
1134
|
+
modeLabel = ( localize(7447, "(Agent), edit files in your workspace."));
|
|
1046
1135
|
break;
|
|
1047
1136
|
case ChatModeKind.Edit:
|
|
1048
|
-
modeLabel = ( localize(
|
|
1137
|
+
modeLabel = ( localize(7448, "(Edit), edit files in your workspace."));
|
|
1049
1138
|
break;
|
|
1050
1139
|
case ChatModeKind.Ask:
|
|
1051
1140
|
default:
|
|
1052
|
-
modeLabel = ( localize(
|
|
1141
|
+
modeLabel = ( localize(7449, "(Ask), ask questions or type / for topics."));
|
|
1053
1142
|
break;
|
|
1054
1143
|
}
|
|
1055
1144
|
}
|
|
1056
1145
|
if (verbose) {
|
|
1057
1146
|
return kbLabel ? ( localize(
|
|
1058
|
-
|
|
1147
|
+
7450,
|
|
1059
1148
|
"Chat Input {0}{1} Press Enter to send out the request. Use {2} for Chat Accessibility Help.",
|
|
1060
1149
|
modeLabel,
|
|
1061
1150
|
modelInfo,
|
|
1062
1151
|
kbLabel
|
|
1063
1152
|
)) : ( localize(
|
|
1064
|
-
|
|
1153
|
+
7451,
|
|
1065
1154
|
"Chat Input {0}{1} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.",
|
|
1066
1155
|
modeLabel,
|
|
1067
1156
|
modelInfo
|
|
1068
1157
|
));
|
|
1069
1158
|
} else {
|
|
1070
|
-
return localize(
|
|
1159
|
+
return localize(7452, "Chat Input {0}{1}.", modeLabel, modelInfo);
|
|
1071
1160
|
}
|
|
1072
1161
|
}
|
|
1073
1162
|
validateCurrentChatMode() {
|
|
1074
1163
|
const currentMode = this._currentModeObservable.get();
|
|
1075
|
-
const validMode = this.
|
|
1164
|
+
const validMode = this._currentChatModesObservable.get().findModeById(currentMode.id);
|
|
1076
1165
|
const isAgentModeEnabled = this.configurationService.getValue(ChatConfiguration.AgentEnabled);
|
|
1077
1166
|
if (!validMode) {
|
|
1078
1167
|
this.setChatMode(isAgentModeEnabled ? ChatModeKind.Agent : ChatModeKind.Ask);
|
|
@@ -1212,6 +1301,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1212
1301
|
this.history.append(this._getFilteredEntry(userQuery));
|
|
1213
1302
|
}
|
|
1214
1303
|
this.resetScrollbarVisibilityAfterAccept();
|
|
1304
|
+
this.chatInputNotificationService.handleMessageSent();
|
|
1215
1305
|
if (this._chatSessionIsEmpty) {
|
|
1216
1306
|
this._chatSessionIsEmpty = false;
|
|
1217
1307
|
this._emptyInputState.set(undefined, undefined);
|
|
@@ -1306,6 +1396,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1306
1396
|
const requiresCustomModels = sessionResource && this.chatSessionsService.requiresCustomModelsForSessionType(getChatSessionType(sessionResource));
|
|
1307
1397
|
this.chatSessionHasTargetedModels.set(!!requiresCustomModels);
|
|
1308
1398
|
const visibleOptionGroups = this.getVisibleOptionGroups(sessionResource);
|
|
1399
|
+
this.permissionWidget?.refresh();
|
|
1309
1400
|
if (!visibleOptionGroups.length) {
|
|
1310
1401
|
this.chatSessionHasOptions.set(false);
|
|
1311
1402
|
this.chatSessionOptionsValid.set(true);
|
|
@@ -1356,6 +1447,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1356
1447
|
}
|
|
1357
1448
|
const visibleGroups = ( new Map());
|
|
1358
1449
|
for (const optionGroup of allOptionGroups) {
|
|
1450
|
+
if (optionGroup.kind === "permissions") {
|
|
1451
|
+
continue;
|
|
1452
|
+
}
|
|
1359
1453
|
const hasItems = optionGroup.items.length > 0 || (optionGroup.commands || []).length > 0;
|
|
1360
1454
|
const passesWhenClause = this.evaluateOptionGroupVisibility(optionGroup);
|
|
1361
1455
|
const sessionHasOption = !sessionResource || this.chatSessionsService.getSessionOption(sessionResource, optionGroup.id) !== undefined;
|
|
@@ -1365,6 +1459,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1365
1459
|
}
|
|
1366
1460
|
return Array.from(( visibleGroups.values()));
|
|
1367
1461
|
}
|
|
1462
|
+
getActiveExtensionPermissionGroup(sessionResource) {
|
|
1463
|
+
const allOptionGroups = this.getAllOptionsGroups(sessionResource);
|
|
1464
|
+
return allOptionGroups.find(
|
|
1465
|
+
g => g.kind === "permissions" && g.items.length > 0 && this.evaluateOptionGroupVisibility(g)
|
|
1466
|
+
);
|
|
1467
|
+
}
|
|
1368
1468
|
refreshChatSessionPickers() {
|
|
1369
1469
|
const sessionResource = this.getCurrentSessionResource();
|
|
1370
1470
|
const allOptionsGroups = this.getAllOptionsGroups(sessionResource);
|
|
@@ -1471,21 +1571,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1471
1571
|
this._widget?.unlockFromCodingAgent();
|
|
1472
1572
|
}
|
|
1473
1573
|
}
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}
|
|
1479
|
-
const delegate = this.options.sessionTypePickerDelegate;
|
|
1480
|
-
const delegateSessionType = delegate?.setActiveSessionProvider && delegate?.getActiveSessionProvider?.();
|
|
1481
|
-
const sessionType = delegateSessionType || this._pendingDelegationTarget || getChatSessionType(sessionResource);
|
|
1482
|
-
const isLocalSession = sessionType === localChatSessionType;
|
|
1483
|
-
if (!isLocalSession) {
|
|
1484
|
-
this._widgetController.clear();
|
|
1485
|
-
return;
|
|
1486
|
-
}
|
|
1487
|
-
if (!this._widgetController.value) {
|
|
1488
|
-
this._widgetController.value = this.instantiationService.createInstance(ChatInputPartWidgetController, this.chatInputWidgetsContainer);
|
|
1574
|
+
ensureNotificationWidget() {
|
|
1575
|
+
if (!this._notificationWidget.value) {
|
|
1576
|
+
this._notificationWidget.value = this.instantiationService.createInstance(ChatInputNotificationWidget);
|
|
1577
|
+
this.chatInputNotificationContainer.appendChild(this._notificationWidget.value.domNode);
|
|
1489
1578
|
}
|
|
1490
1579
|
}
|
|
1491
1580
|
showContextUsageDetails() {
|
|
@@ -1520,7 +1609,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1520
1609
|
this._pendingDelegationTarget = undefined;
|
|
1521
1610
|
this.updateAgentSessionTypeContextKey();
|
|
1522
1611
|
this.refreshChatSessionPickers();
|
|
1523
|
-
this.
|
|
1612
|
+
this.ensureNotificationWidget();
|
|
1524
1613
|
this.updateContextUsageWidget();
|
|
1525
1614
|
let hasMatchingResource = false;
|
|
1526
1615
|
if (e.currentSessionResource) {
|
|
@@ -1564,7 +1653,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1564
1653
|
h(
|
|
1565
1654
|
".chat-tool-confirmation-carousel-container@chatToolConfirmationCarouselContainer"
|
|
1566
1655
|
),
|
|
1567
|
-
h(".chat-input-
|
|
1656
|
+
h(".chat-input-notification-container@chatInputNotificationContainer"),
|
|
1568
1657
|
h(".chat-todo-list-widget-container@chatInputTodoListWidgetContainer"),
|
|
1569
1658
|
h(".chat-artifacts-widget-container@chatArtifactsWidgetContainer"),
|
|
1570
1659
|
h(".chat-editing-session@chatEditingSessionWidgetContainer"),
|
|
@@ -1594,7 +1683,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1594
1683
|
".chat-tool-confirmation-carousel-container@chatToolConfirmationCarouselContainer"
|
|
1595
1684
|
),
|
|
1596
1685
|
h(".interactive-input-followups@followupsContainer"),
|
|
1597
|
-
h(".chat-input-
|
|
1686
|
+
h(".chat-input-notification-container@chatInputNotificationContainer"),
|
|
1598
1687
|
h(".chat-todo-list-widget-container@chatInputTodoListWidgetContainer"),
|
|
1599
1688
|
h(".chat-artifacts-widget-container@chatArtifactsWidgetContainer"),
|
|
1600
1689
|
h(".chat-editing-session@chatEditingSessionWidgetContainer"),
|
|
@@ -1639,7 +1728,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1639
1728
|
this.chatPlanReviewContainer = elements.chatPlanReviewContainer;
|
|
1640
1729
|
this.chatToolConfirmationCarouselContainer = elements.chatToolConfirmationCarouselContainer;
|
|
1641
1730
|
hide(this.chatToolConfirmationCarouselContainer);
|
|
1642
|
-
this.
|
|
1731
|
+
this.chatInputNotificationContainer = elements.chatInputNotificationContainer;
|
|
1643
1732
|
this.contextUsageWidgetContainer = elements.contextUsageWidgetContainer;
|
|
1644
1733
|
if (this.options.isSessionsWindow || this.options.renderStyle === "compact") {
|
|
1645
1734
|
toolbarsContainer.prepend(this.contextUsageWidgetContainer);
|
|
@@ -1657,7 +1746,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1657
1746
|
this._implicitContext?.dispose();
|
|
1658
1747
|
this._implicitContext = undefined;
|
|
1659
1748
|
}
|
|
1660
|
-
this.
|
|
1749
|
+
this.ensureNotificationWidget();
|
|
1661
1750
|
this._register(this._attachmentModel.onDidChange(e => {
|
|
1662
1751
|
if (e.added.length > 0) {
|
|
1663
1752
|
this._indexOfLastAttachedContextDeletedWithKeyboard = -1;
|
|
@@ -1792,6 +1881,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1792
1881
|
reader => this._stableInputPartWidth.read(reader) < CHAT_INPUT_PICKER_COLLAPSE_WIDTH
|
|
1793
1882
|
)
|
|
1794
1883
|
};
|
|
1884
|
+
const secondaryPickerOptions = {
|
|
1885
|
+
...pickerOptions,
|
|
1886
|
+
getOverflowAnchor: () => this.secondaryToolbar.getElement()
|
|
1887
|
+
};
|
|
1795
1888
|
this._register(
|
|
1796
1889
|
addStandardDisposableListener(toolbarsContainer, EventType.CLICK, e => this.inputEditor.focus())
|
|
1797
1890
|
);
|
|
@@ -1820,45 +1913,31 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1820
1913
|
getActionMinWidth: action => ( shorterChatInputActionIds.has(action.id)) ? 22 : undefined
|
|
1821
1914
|
},
|
|
1822
1915
|
actionViewItemProvider: (action, options) => {
|
|
1916
|
+
if (this.chatPhoneInputPresenter.enabled.get()) {
|
|
1917
|
+
if (action.id === OpenModelPickerAction.ID && action instanceof MenuItemAction) {
|
|
1918
|
+
if (!this._currentLanguageModel.get()) {
|
|
1919
|
+
this.setCurrentLanguageModelToDefault();
|
|
1920
|
+
}
|
|
1921
|
+
const modelDelegate = this._createModelPickerDelegate();
|
|
1922
|
+
const modeDelegate = this._createModePickerDelegate();
|
|
1923
|
+
return this.instantiationService.createInstance(
|
|
1924
|
+
MobileChatInputCombinedPickerActionItem,
|
|
1925
|
+
action,
|
|
1926
|
+
modeDelegate,
|
|
1927
|
+
modelDelegate
|
|
1928
|
+
);
|
|
1929
|
+
} else if (action.id === OpenModePickerAction.ID && action instanceof MenuItemAction) {
|
|
1930
|
+
return ( new HiddenActionViewItem(action));
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1823
1933
|
if (action.id === OpenModelPickerAction.ID && action instanceof MenuItemAction) {
|
|
1824
|
-
if (!this._currentLanguageModel) {
|
|
1934
|
+
if (!this._currentLanguageModel.get()) {
|
|
1825
1935
|
this.setCurrentLanguageModelToDefault();
|
|
1826
1936
|
}
|
|
1827
|
-
const itemDelegate =
|
|
1828
|
-
currentModel: this._currentLanguageModel,
|
|
1829
|
-
setModel: model => {
|
|
1830
|
-
this._waitForPersistedLanguageModel.clear();
|
|
1831
|
-
this.setCurrentLanguageModel(model);
|
|
1832
|
-
this.renderAttachedContext();
|
|
1833
|
-
},
|
|
1834
|
-
getModels: () => this.getModels(),
|
|
1835
|
-
useGroupedModelPicker: () => {
|
|
1836
|
-
const sessionType = this.getCurrentSessionType();
|
|
1837
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
1838
|
-
},
|
|
1839
|
-
showManageModelsAction: () => {
|
|
1840
|
-
const sessionType = this.getCurrentSessionType();
|
|
1841
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
1842
|
-
},
|
|
1843
|
-
showUnavailableFeatured: () => {
|
|
1844
|
-
const sessionType = this.getCurrentSessionType();
|
|
1845
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
1846
|
-
},
|
|
1847
|
-
showFeatured: () => {
|
|
1848
|
-
const sessionType = this.getCurrentSessionType();
|
|
1849
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
1850
|
-
}
|
|
1851
|
-
};
|
|
1937
|
+
const itemDelegate = this._createModelPickerDelegate();
|
|
1852
1938
|
return this.modelWidget = this.instantiationService.createInstance(ModelPickerActionItem, action, itemDelegate, pickerOptions);
|
|
1853
1939
|
} else if (action.id === OpenModePickerAction.ID && action instanceof MenuItemAction) {
|
|
1854
|
-
const delegate =
|
|
1855
|
-
currentMode: this._currentModeObservable,
|
|
1856
|
-
sessionResource: () => this._widget?.viewModel?.sessionResource,
|
|
1857
|
-
customAgentTarget: () => {
|
|
1858
|
-
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
1859
|
-
return (sessionResource && this.chatSessionsService.getCustomAgentTargetForSessionType(getChatSessionType(sessionResource))) ?? Target.Undefined;
|
|
1860
|
-
}
|
|
1861
|
-
};
|
|
1940
|
+
const delegate = this._createModePickerDelegate();
|
|
1862
1941
|
return this.modeWidget = this.instantiationService.createInstance(ModePickerActionItem, action, delegate, pickerOptions);
|
|
1863
1942
|
} else if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
1864
1943
|
const getActiveSessionType = () => {
|
|
@@ -1890,17 +1969,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1890
1969
|
delegate,
|
|
1891
1970
|
pickerOptions
|
|
1892
1971
|
);
|
|
1893
|
-
} else if (action.id === OpenWorkspacePickerAction.ID && action instanceof MenuItemAction) {
|
|
1894
|
-
if (this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY && this.options.workspacePickerDelegate) {
|
|
1895
|
-
return this.instantiationService.createInstance(
|
|
1896
|
-
WorkspacePickerActionItem,
|
|
1897
|
-
action,
|
|
1898
|
-
this.options.workspacePickerDelegate,
|
|
1899
|
-
pickerOptions
|
|
1900
|
-
);
|
|
1901
|
-
} else {
|
|
1902
|
-
return ( new HiddenActionViewItem(action));
|
|
1903
|
-
}
|
|
1904
1972
|
} else if (action.id === ChatSessionPrimaryPickerAction.ID && action instanceof MenuItemAction) {
|
|
1905
1973
|
const widgets = this.createChatSessionPickerWidgets(action, pickerOptions);
|
|
1906
1974
|
if (widgets.length === 0) {
|
|
@@ -1918,8 +1986,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1918
1986
|
};
|
|
1919
1987
|
this._register(this.inputActionsToolbar.onDidChangeMenuItems(() => {
|
|
1920
1988
|
const toolbarElement = this.inputActionsToolbar.getElement();
|
|
1921
|
-
const
|
|
1922
|
-
|
|
1989
|
+
const primaryPickerContainer = toolbarElement.querySelector(".chat-sessionPicker-container");
|
|
1990
|
+
if (primaryPickerContainer) {
|
|
1991
|
+
this.chatSessionPickerContainer = primaryPickerContainer;
|
|
1992
|
+
}
|
|
1923
1993
|
if (this.cachedWidth && typeof this.cachedInputToolbarWidth === "number" && this.cachedInputToolbarWidth !== this.inputActionsToolbar.getItemsWidth()) {
|
|
1924
1994
|
this._toolbarRelayoutScheduler.schedule();
|
|
1925
1995
|
}
|
|
@@ -1928,6 +1998,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1928
1998
|
pickerOptions.hideChevrons.read(reader);
|
|
1929
1999
|
queueMicrotask(() => this.inputActionsToolbar.relayout());
|
|
1930
2000
|
}));
|
|
2001
|
+
let lastPhoneEnabled = this.chatPhoneInputPresenter.enabled.get();
|
|
2002
|
+
this._register(autorun(reader => {
|
|
2003
|
+
const enabled = this.chatPhoneInputPresenter.enabled.read(reader);
|
|
2004
|
+
if (enabled !== lastPhoneEnabled) {
|
|
2005
|
+
lastPhoneEnabled = enabled;
|
|
2006
|
+
this.inputActionsToolbar.refresh();
|
|
2007
|
+
}
|
|
2008
|
+
}));
|
|
1931
2009
|
this.executeToolbar = this._register(this.instantiationService.createInstance(
|
|
1932
2010
|
MenuWorkbenchToolBar,
|
|
1933
2011
|
toolbarsContainer,
|
|
@@ -1980,6 +2058,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1980
2058
|
},
|
|
1981
2059
|
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
1982
2060
|
hoverDelegate,
|
|
2061
|
+
responsiveBehavior: {
|
|
2062
|
+
enabled: true,
|
|
2063
|
+
kind: "last",
|
|
2064
|
+
minItems: 1,
|
|
2065
|
+
actionMinWidth: 48
|
|
2066
|
+
},
|
|
1983
2067
|
actionViewItemProvider: (action, options) => {
|
|
1984
2068
|
if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
1985
2069
|
const getActiveSessionType = () => {
|
|
@@ -2009,7 +2093,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2009
2093
|
action,
|
|
2010
2094
|
location === ChatWidgetLocation.Editor ? "editor" : "sidebar",
|
|
2011
2095
|
delegate,
|
|
2012
|
-
|
|
2096
|
+
secondaryPickerOptions
|
|
2013
2097
|
);
|
|
2014
2098
|
} else if (action.id === OpenWorkspacePickerAction.ID && action instanceof MenuItemAction) {
|
|
2015
2099
|
if (this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY && this.options.workspacePickerDelegate) {
|
|
@@ -2017,23 +2101,59 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2017
2101
|
WorkspacePickerActionItem,
|
|
2018
2102
|
action,
|
|
2019
2103
|
this.options.workspacePickerDelegate,
|
|
2020
|
-
|
|
2104
|
+
secondaryPickerOptions
|
|
2021
2105
|
);
|
|
2022
2106
|
} else {
|
|
2023
|
-
|
|
2024
|
-
if (empty.element) {
|
|
2025
|
-
empty.element.style.display = "none";
|
|
2026
|
-
}
|
|
2027
|
-
return empty;
|
|
2107
|
+
return ( new HiddenActionViewItem(action));
|
|
2028
2108
|
}
|
|
2029
2109
|
} else if (action.id === OpenPermissionPickerAction.ID && action instanceof MenuItemAction) {
|
|
2030
2110
|
const delegate = {
|
|
2031
2111
|
currentPermissionLevel: this._currentPermissionLevel,
|
|
2032
2112
|
setPermissionLevel: level => {
|
|
2033
2113
|
this.setPermissionLevel(level);
|
|
2114
|
+
},
|
|
2115
|
+
getExtensionPermissions: () => {
|
|
2116
|
+
const sessionResource = this.getCurrentSessionResource();
|
|
2117
|
+
const group = this.getActiveExtensionPermissionGroup(sessionResource);
|
|
2118
|
+
if (!group) {
|
|
2119
|
+
return undefined;
|
|
2120
|
+
}
|
|
2121
|
+
const current = sessionResource ? this.chatSessionsService.getSessionOption(sessionResource, group.id) : undefined;
|
|
2122
|
+
const defaultId = group.selected?.id ?? group.items.find(i => i.default)?.id;
|
|
2123
|
+
const rawSelectedId = current === undefined ? defaultId : typeof current === "string" ? current : current.id;
|
|
2124
|
+
const selectedId = rawSelectedId !== undefined && ( group.items.some(i => i.id === rawSelectedId)) ? rawSelectedId : defaultId;
|
|
2125
|
+
const sessionType = sessionResource ? getChatSessionType(sessionResource) : (this.options.sessionTypePickerDelegate?.getActiveSessionProvider?.() ?? "");
|
|
2126
|
+
return {
|
|
2127
|
+
sessionType,
|
|
2128
|
+
groupId: group.id,
|
|
2129
|
+
items: group.items,
|
|
2130
|
+
selectedId
|
|
2131
|
+
};
|
|
2132
|
+
},
|
|
2133
|
+
setExtensionPermission: (groupId, item) => {
|
|
2134
|
+
this.updateOptionContextKey(groupId, item.id);
|
|
2135
|
+
this.getOrCreateOptionEmitter(groupId).fire(item);
|
|
2136
|
+
const sessionResource = this.getCurrentSessionResource();
|
|
2137
|
+
if (sessionResource) {
|
|
2138
|
+
this.chatSessionsService.setSessionOption(sessionResource, groupId, item);
|
|
2139
|
+
}
|
|
2140
|
+
this.permissionWidget?.refresh();
|
|
2034
2141
|
}
|
|
2035
2142
|
};
|
|
2036
|
-
|
|
2143
|
+
const widget = this.instantiationService.createInstance(PermissionPickerActionItem, action, delegate, secondaryPickerOptions);
|
|
2144
|
+
this.permissionWidget = widget;
|
|
2145
|
+
this._register(widget.onDidDispose(() => {
|
|
2146
|
+
if (this.permissionWidget === widget) {
|
|
2147
|
+
this.permissionWidget = undefined;
|
|
2148
|
+
}
|
|
2149
|
+
}));
|
|
2150
|
+
return widget;
|
|
2151
|
+
} else if (action.id === ChatSessionPrimaryPickerAction.ID && action instanceof MenuItemAction) {
|
|
2152
|
+
const widgets = this.createChatSessionPickerWidgets(action, secondaryPickerOptions);
|
|
2153
|
+
if (widgets.length === 0) {
|
|
2154
|
+
return ( new HiddenActionViewItem(action));
|
|
2155
|
+
}
|
|
2156
|
+
return this.instantiationService.createInstance(ChatSessionPickersContainerActionItem, action, widgets);
|
|
2037
2157
|
}
|
|
2038
2158
|
return undefined;
|
|
2039
2159
|
}
|
|
@@ -2043,9 +2163,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2043
2163
|
this.secondaryToolbar.context = {
|
|
2044
2164
|
widget
|
|
2045
2165
|
};
|
|
2166
|
+
this._register(this.secondaryToolbar.onDidChangeMenuItems(() => {
|
|
2167
|
+
const toolbarElement = this.secondaryToolbar.getElement();
|
|
2168
|
+
const container = toolbarElement.querySelector(".chat-sessionPicker-container");
|
|
2169
|
+
if (isHTMLElement(container)) {
|
|
2170
|
+
this.chatSessionPickerContainer = container;
|
|
2171
|
+
}
|
|
2172
|
+
}));
|
|
2046
2173
|
let inputModel = this.modelService.getModel(this.inputUri);
|
|
2047
2174
|
if (!inputModel) {
|
|
2048
|
-
inputModel = this.modelService.createModel("", null, this.inputUri, true);
|
|
2175
|
+
inputModel = this._register(this.modelService.createModel("", null, this.inputUri, true));
|
|
2049
2176
|
}
|
|
2050
2177
|
this.textModelResolverService.createModelReference(this.inputUri).then(ref => {
|
|
2051
2178
|
if (this._store.isDisposed) {
|
|
@@ -2093,14 +2220,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2093
2220
|
this.renderAttachedContext();
|
|
2094
2221
|
}));
|
|
2095
2222
|
this.renderAttachedContext();
|
|
2096
|
-
const inputResizeObserver = this._register(new DisposableResizeObserver(() => {
|
|
2223
|
+
const inputResizeObserver = this._register(new DisposableResizeObserver("ChatInputPart.containerHeight", () => {
|
|
2097
2224
|
this.updateToolConfirmationCarouselMaxHeight();
|
|
2098
2225
|
const newHeight = this.container.offsetHeight;
|
|
2099
2226
|
this.height.set(newHeight, undefined);
|
|
2100
2227
|
}));
|
|
2101
2228
|
this._register(inputResizeObserver.observe(this.container));
|
|
2102
2229
|
if (this.options.renderStyle === "compact") {
|
|
2103
|
-
const toolbarsResizeObserver = this._register(new DisposableResizeObserver(() => {
|
|
2230
|
+
const toolbarsResizeObserver = this._register(new DisposableResizeObserver("ChatInputPart.compactToolbars", () => {
|
|
2104
2231
|
if (this.cachedWidth) {
|
|
2105
2232
|
this.layout(this.cachedWidth);
|
|
2106
2233
|
}
|
|
@@ -2320,6 +2447,15 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2320
2447
|
container,
|
|
2321
2448
|
this._contextResourceLabels
|
|
2322
2449
|
);
|
|
2450
|
+
} else if (isBrowserViewVariableEntry(attachment)) {
|
|
2451
|
+
attachmentWidget = this.instantiationService.createInstance(
|
|
2452
|
+
BrowserViewAttachmentWidget,
|
|
2453
|
+
attachment,
|
|
2454
|
+
lm,
|
|
2455
|
+
options,
|
|
2456
|
+
container,
|
|
2457
|
+
this._contextResourceLabels
|
|
2458
|
+
);
|
|
2323
2459
|
} else {
|
|
2324
2460
|
attachmentWidget = this._chatAttachmentWidgetRegistry.createWidget(attachment, options, container) ?? this.instantiationService.createInstance(
|
|
2325
2461
|
DefaultChatAttachmentWidget,
|
|
@@ -2510,6 +2646,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2510
2646
|
const carousel = this.questionCarousel;
|
|
2511
2647
|
return carousel?.navigateToNextQuestion() ?? false;
|
|
2512
2648
|
}
|
|
2649
|
+
focusQuestionCarouselTerminal() {
|
|
2650
|
+
const carousel = this.questionCarousel;
|
|
2651
|
+
return carousel?.focusTerminal() ?? false;
|
|
2652
|
+
}
|
|
2513
2653
|
renderPlanReview(review, context, options) {
|
|
2514
2654
|
const key = review.resolveId ?? `${isResponseVM(context.element) ? context.element.requestId : ""}_${context.contentIndex}`;
|
|
2515
2655
|
const existing = this._chatPlanReviewWidgets.get(key);
|
|
@@ -2581,13 +2721,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2581
2721
|
show(this.chatToolConfirmationCarouselContainer);
|
|
2582
2722
|
this.updateToolConfirmationCarouselMaxHeight();
|
|
2583
2723
|
const capturedKey = key;
|
|
2584
|
-
Event.once(part.onDidEmpty)(() => {
|
|
2724
|
+
this._register(Event.once(part.onDidEmpty)(() => {
|
|
2585
2725
|
this._chatToolConfirmationCarousels.deleteAndDispose(capturedKey);
|
|
2586
2726
|
if (this._currentSessionKey === capturedKey) {
|
|
2587
2727
|
clearNode(this.chatToolConfirmationCarouselContainer);
|
|
2588
2728
|
hide(this.chatToolConfirmationCarouselContainer);
|
|
2589
2729
|
}
|
|
2590
|
-
});
|
|
2730
|
+
}));
|
|
2591
2731
|
return part;
|
|
2592
2732
|
}
|
|
2593
2733
|
addToolToConfirmationCarousel(tool, factory, subAgentInvocationId, agentName, scrollToSubagent, toolPart) {
|
|
@@ -2745,7 +2885,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2745
2885
|
const button = this._chatEditsActionsDisposables.add(( new ButtonWithIcon(overviewTitle, {
|
|
2746
2886
|
supportIcons: true,
|
|
2747
2887
|
secondary: true,
|
|
2748
|
-
ariaLabel: ( localize(
|
|
2888
|
+
ariaLabel: ( localize(7453, "Toggle changed files."))
|
|
2749
2889
|
})));
|
|
2750
2890
|
const topLevelStats = derived(reader => {
|
|
2751
2891
|
const entries = editSessionEntriesObs.read(reader);
|
|
@@ -2819,10 +2959,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2819
2959
|
removed,
|
|
2820
2960
|
shouldShowEditingSession
|
|
2821
2961
|
} = topLevelStats.read(reader);
|
|
2822
|
-
const buttonLabel = files === 1 ? ( localize(
|
|
2962
|
+
const buttonLabel = files === 1 ? ( localize(7454, "1 file changed")) : ( localize(7455, "{0} files changed", files));
|
|
2823
2963
|
button.label = buttonLabel;
|
|
2824
2964
|
button.element.setAttribute("aria-label", ( localize(
|
|
2825
|
-
|
|
2965
|
+
7456,
|
|
2826
2966
|
"{0}, {1} lines added, {2} lines removed",
|
|
2827
2967
|
buttonLabel,
|
|
2828
2968
|
added,
|
|
@@ -2956,8 +3096,31 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2956
3096
|
layout(width) {
|
|
2957
3097
|
this.cachedWidth = width;
|
|
2958
3098
|
this._stableInputPartWidth.set(width, undefined);
|
|
3099
|
+
this._updateWorkingProgressAnimationDuration(width);
|
|
2959
3100
|
return this._layout(width);
|
|
2960
3101
|
}
|
|
3102
|
+
_updateWorkingProgressAnimationDuration(width) {
|
|
3103
|
+
if (!this.inputContainer) {
|
|
3104
|
+
return;
|
|
3105
|
+
}
|
|
3106
|
+
const MIN_DURATION_S = 1.4;
|
|
3107
|
+
const MAX_DURATION_S = 2.5;
|
|
3108
|
+
const safeWidth = Math.max(50, width);
|
|
3109
|
+
const raw = 0.55 + 0.075 * Math.sqrt(safeWidth);
|
|
3110
|
+
const duration = Math.min(MAX_DURATION_S, Math.max(MIN_DURATION_S, raw));
|
|
3111
|
+
if (this._lastAnimDurationS !== undefined && Math.abs(this._lastAnimDurationS - duration) < 0.05) {
|
|
3112
|
+
return;
|
|
3113
|
+
}
|
|
3114
|
+
this._lastAnimDurationS = duration;
|
|
3115
|
+
this.inputContainer.style.setProperty("--chat-input-anim-duration", `${duration.toFixed(2)}s`);
|
|
3116
|
+
if (this.inputContainer.classList.contains("working")) {
|
|
3117
|
+
const inputContainer = this.inputContainer;
|
|
3118
|
+
inputContainer.classList.add("chat-input-anim-restart");
|
|
3119
|
+
scheduleAtNextAnimationFrame(getWindow(inputContainer), () => {
|
|
3120
|
+
inputContainer.classList.remove("chat-input-anim-restart");
|
|
3121
|
+
});
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
2961
3124
|
get _effectiveInputEditorMaxHeight() {
|
|
2962
3125
|
if (this._maxHeight === undefined) {
|
|
2963
3126
|
return this.inputEditorMaxHeight;
|
|
@@ -3084,7 +3247,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3084
3247
|
this.updateInputEditorScrollbarOptions();
|
|
3085
3248
|
}
|
|
3086
3249
|
};
|
|
3087
|
-
ChatInputPart = ChatInputPart_1 = ( __decorate([( __param(4, IModelService)), ( __param(5, IInstantiationService)), ( __param(6, IContextKeyService)), ( __param(7, IConfigurationService)), ( __param(8, IKeybindingService)), ( __param(9, IAccessibilityService)), ( __param(10, ILanguageModelsService)), ( __param(11, ILogService)), ( __param(12, IFileService)), ( __param(13, IEditorService)), ( __param(14, IThemeService)), ( __param(15, ITextModelService)), ( __param(16, IStorageService)), ( __param(17, IChatAgentService)), ( __param(18, ISharedWebContentExtractorService)), ( __param(19, IChatEntitlementService)), ( __param(20, IChatModeService)), ( __param(21, ILanguageModelToolsService)), ( __param(22, IChatSessionsService)), ( __param(23, IChatContextService)), ( __param(24, IAgentSessionsService)), ( __param(25, IWorkspaceContextService)), ( __param(26, ISCMService)), ( __param(27, IWorkbenchLayoutService)), ( __param(28, IViewDescriptorService)), ( __param(29, IChatAttachmentWidgetRegistry))], ChatInputPart));
|
|
3250
|
+
ChatInputPart = ChatInputPart_1 = ( __decorate([( __param(4, IModelService)), ( __param(5, IInstantiationService)), ( __param(6, IContextKeyService)), ( __param(7, IConfigurationService)), ( __param(8, IKeybindingService)), ( __param(9, IAccessibilityService)), ( __param(10, ILanguageModelsService)), ( __param(11, ILogService)), ( __param(12, IFileService)), ( __param(13, IEditorService)), ( __param(14, IThemeService)), ( __param(15, ITextModelService)), ( __param(16, IStorageService)), ( __param(17, IChatAgentService)), ( __param(18, ISharedWebContentExtractorService)), ( __param(19, IChatEntitlementService)), ( __param(20, IChatModeService)), ( __param(21, ILanguageModelToolsService)), ( __param(22, IChatSessionsService)), ( __param(23, IChatContextService)), ( __param(24, IAgentSessionsService)), ( __param(25, IWorkspaceContextService)), ( __param(26, ISCMService)), ( __param(27, IWorkbenchLayoutService)), ( __param(28, IViewDescriptorService)), ( __param(29, IChatAttachmentWidgetRegistry)), ( __param(30, IChatInputNotificationService)), ( __param(31, IChatPhoneInputPresenter))], ChatInputPart));
|
|
3088
3251
|
function getLastPosition(model) {
|
|
3089
3252
|
return {
|
|
3090
3253
|
lineNumber: model.getLineCount(),
|