@codingame/monaco-vscode-katex-common 34.1.3 → 35.0.1
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/base/browser/animationSync.d.ts +36 -0
- package/vscode/src/vs/base/browser/animationSync.js +23 -0
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.js +23 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +3 -2
- package/vscode/src/vs/platform/agentHost/common/claudeSessionConfigKeys.d.ts +5 -5
- package/vscode/src/vs/platform/agentHost/common/fileEditDiff.d.ts +32 -0
- package/vscode/src/vs/platform/agentHost/common/fileEditDiff.js +33 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentFeedbackAnnotations.d.ts +90 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentFeedbackAttachments.d.ts +30 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentToolCallMeta.d.ts +65 -0
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.d.ts +16 -5
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.js +3 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-resource-watch/reducer.d.ts +21 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +8 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionReducers.d.ts +9 -0
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +105 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +74 -44
- 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.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +98 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +31 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +45 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +163 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFolderPickerActionItem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostFolderPickerActionItem.js +172 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionReferenceAttachment.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSnapshotController.d.ts +116 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSnapshotController.js +348 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.d.ts +211 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/stateToProgressAdapter.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +30 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +29 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +119 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionTypeAvailability.d.ts +63 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionTypeAvailability.js +97 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +105 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +46 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatTurnPills.css +162 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +95 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +151 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +20 -2
- 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.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +61 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAutoModeResolutionContentPart.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAutoModeResolutionContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +81 -30
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +9 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.js +21 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- 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.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpAuthenticationContentPart.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpAuthenticationContentPart.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersStartingContentPart.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersStartingContentPart.js +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +29 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +44 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +12 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- 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.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +167 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +1 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +9 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSystemNotificationContentPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSystemNotificationContentPart.js +23 -0
- 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 +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +141 -72
- 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.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTurnPillsPart.js +110 -0
- 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.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatAgentFeedbackReviewConfirmation.css +133 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatAutoModeResolution.css +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +18 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPlanReview.css +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +33 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatToolConfirmationCarousel.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +21 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatAgentFeedbackReviewConfirmationSubPart.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatAgentFeedbackReviewConfirmationSubPart.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +43 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +53 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +7 -9
- 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/chatModifiedFilesConfirmationSubPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +24 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/{chatMissingSandboxDepsConfirmationSubPart.d.ts → chatSandboxPrerequisiteConfirmationSubPart.d.ts} +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/{chatMissingSandboxDepsConfirmationSubPart.js → chatSandboxPrerequisiteConfirmationSubPart.js} +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +30 -59
- 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 +41 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +12 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +43 -35
- 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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +11 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeHelper.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeHelper.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +4 -4
- 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 +18 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +266 -98
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatRestoreCheckpointActionViewItem.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatRestoreCheckpointActionViewItem.js +135 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatTurnPills.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatTurnPills.js +275 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +84 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +52 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +187 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +435 -139
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatePersistence.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatePersistence.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationLogic.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationLogic.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.d.ts +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelConfigurationStore.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +84 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +658 -430
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +72 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +82 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +23 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatGoalBannerWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +28 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +18 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +49 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +141 -81
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +7 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +30 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerInputActionItem.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerInputActionItem.js +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +469 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +79 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +71 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +107 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatErrorMessages.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatErrorMessages.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +57 -21
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +39 -8
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +168 -72
- 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/chat/browser/widget/input/chatInputStatusActionViewItem.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.js +0 -147
|
@@ -56,6 +56,7 @@ import { canLog, LogLevel } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
56
56
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
57
57
|
import { observableMemento } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/observableMemento';
|
|
58
58
|
import { bindContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/observable/common/platformObservableUtils';
|
|
59
|
+
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
59
60
|
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
60
61
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
61
62
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
@@ -78,20 +79,22 @@ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
|
|
|
78
79
|
import { ChatRequestVariableSet, isImageVariableEntry, isExplicitFileOrImageVariableEntry, 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
80
|
import { getModeNameForTelemetry, ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
80
81
|
import { IChatModeService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModes.service';
|
|
81
|
-
import { SessionType, localChatSessionType, isIChatSessionFileChange2 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
82
|
+
import { SessionType, localChatSessionType, isAgentHostTarget, isIChatSessionFileChange2 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
82
83
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
83
84
|
import { ChatAgentLocation, ChatModeKind, ChatConfiguration, ChatPermissionLevel, isChatPermissionLevel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
84
85
|
import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
85
86
|
import { ILanguageModelChatMetadata } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
86
87
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
88
|
+
import { ChatModelConfigurationStore } from './chatModelConfigurationStore.js';
|
|
89
|
+
import { deserializeUntitledInputState, serializeUntitledInputState, deserializeUntitledInputAttachments, serializeUntitledInputAttachments } from './chatInputStatePersistence.js';
|
|
87
90
|
import { logChangesToStateModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatModel';
|
|
88
|
-
import { filterModelsForSession, shouldResetOnModelListChange, shouldRestorePersistedModel, shouldRestoreLateArrivingModel, resolveModelFromSyncState, shouldResetModelToDefault, mergeModelsWithCache,
|
|
91
|
+
import { filterModelsForSession, shouldResetOnModelListChange, findBestMatchingModel, hasModelsTargetingSession, resolveConfiguredModel, shouldRestorePersistedModel, shouldRestoreLateArrivingModel, resolveModelFromSyncState, shouldResetModelToDefault, mergeModelsWithCache, isModelValidForSession, findDefaultModel } from './chatModelSelectionLogic.js';
|
|
89
92
|
import { LocalChatSessionUri, getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
90
93
|
import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
91
94
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
92
95
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
93
96
|
import { ChatHistoryNavigator } from '../../../common/widget/chatWidgetHistoryService.js';
|
|
94
|
-
import { ChatSubmitAction, OpenModePickerAction, OpenModelPickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction, ChatSessionPrimaryPickerAction, OpenWorkspacePickerAction, OpenPermissionPickerAction } from '../../actions/chatExecuteActions.js';
|
|
97
|
+
import { ChatSubmitAction, OpenModePickerAction, OpenModelPickerAction, OpenAutomationsWorkspacePickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction, ChatSessionPrimaryPickerAction, OpenWorkspacePickerAction, OpenPermissionPickerAction } from '../../actions/chatExecuteActions.js';
|
|
95
98
|
import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
96
99
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
97
100
|
import { ChatAttachmentModel } from '../../attachments/chatAttachmentModel.js';
|
|
@@ -104,8 +107,9 @@ import { ChatEditingShowChangesAction, ViewPreviousEditsAction } from '../../cha
|
|
|
104
107
|
import { resizeImage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatImageUtils';
|
|
105
108
|
import { ChatSessionPickerActionItem } from '../../chatSessions/chatSessionPickerActionItem.js';
|
|
106
109
|
import { AgentHostChatInputPicker, AgentHostChatInputPickerActionViewItem } from '../../agentSessions/agentHost/agentHostChatInputPicker.js';
|
|
107
|
-
import { OpenAgentHostModePickerAction, OpenAgentHostAutoApprovePickerAction, OpenAgentHostPermissionModePickerAction } from '../../agentSessions/agentHost/agentHostChatInputPicker.contribution.js';
|
|
110
|
+
import { OpenAgentHostModePickerAction, OpenAgentHostAutoApprovePickerAction, OpenAgentHostPermissionModePickerAction, OpenAgentHostFolderPickerAction } from '../../agentSessions/agentHost/agentHostChatInputPicker.contribution.js';
|
|
108
111
|
import { AgentHostGenericConfigChips } from '../../agentSessions/agentHost/agentHostGenericConfigChips.js';
|
|
112
|
+
import { AgentHostFolderPickerActionItem } from '../../agentSessions/agentHost/agentHostFolderPickerActionItem.js';
|
|
109
113
|
import { SessionConfigKey } from '../../../../../../platform/agentHost/common/sessionConfigKeys.js';
|
|
110
114
|
import { ClaudeSessionConfigKey } from '../../../../../../platform/agentHost/common/claudeSessionConfigKeys.js';
|
|
111
115
|
import { MobileChatInputCombinedPickerActionItem } from './chatPhoneInputPresenter.js';
|
|
@@ -125,16 +129,17 @@ import { ChatInputNotificationWidget } from './chatInputNotificationWidget.js';
|
|
|
125
129
|
import { ChatSelectedTools } from './chatSelectedTools.js';
|
|
126
130
|
import { DelegationSessionPickerActionItem } from './delegationSessionPickerActionItem.js';
|
|
127
131
|
import { ModelPickerActionItem } from './modelPickerActionItem.js';
|
|
128
|
-
import { ModePickerActionItem } from './modePickerActionItem.js';
|
|
132
|
+
import { isModeConsideredBuiltIn, ModePickerActionItem } from './modePickerActionItem.js';
|
|
129
133
|
import { PermissionPickerActionItem } from './permissionPickerActionItem.js';
|
|
130
134
|
import { SessionTypePickerActionItem } from './sessionTargetPickerActionItem.js';
|
|
131
135
|
import { WorkspacePickerActionItem } from './workspacePickerActionItem.js';
|
|
136
|
+
import { WorkspacePickerInputActionItem } from './workspacePickerInputActionItem.js';
|
|
132
137
|
import { ChatContextUsageWidget } from '../../widgetHosts/viewPane/chatContextUsageWidget.js';
|
|
133
|
-
import { ChatInputStatusActionViewItem } from './chatInputStatusActionViewItem.js';
|
|
134
138
|
import { Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
135
139
|
import { findLast } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arraysFind';
|
|
136
140
|
import { ConfigureToolsAction } from '../../actions/chatToolActions.js';
|
|
137
141
|
import { InlineCompletionsController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController';
|
|
142
|
+
import { PlaceholderTextContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/placeholderText/browser/placeholderTextContribution';
|
|
138
143
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
139
144
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
140
145
|
import { derived, derivedOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
@@ -165,24 +170,39 @@ var ChatWidgetLocation;
|
|
|
165
170
|
ChatWidgetLocation["Panel"] = "panel";
|
|
166
171
|
ChatWidgetLocation["Editor"] = "editor";
|
|
167
172
|
})(ChatWidgetLocation || (ChatWidgetLocation = {}));
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
fromStorage(value) {
|
|
173
|
-
const obj = JSON.parse(value);
|
|
174
|
-
if (obj.selectedModel && !obj.selectedModel.metadata.isDefaultForLocation) {
|
|
175
|
-
const oldIsDefault = obj.selectedModel.metadata.isDefault;
|
|
176
|
-
const isDefaultForLocation = {
|
|
177
|
-
[ChatAgentLocation.Chat]: Boolean(oldIsDefault)
|
|
178
|
-
};
|
|
179
|
-
mixin(obj.selectedModel.metadata, {
|
|
180
|
-
isDefaultForLocation: isDefaultForLocation
|
|
181
|
-
});
|
|
182
|
-
delete obj.selectedModel.metadata.isDefault;
|
|
183
|
-
}
|
|
184
|
-
return obj;
|
|
173
|
+
const LEGACY_SHARED_INPUT_STATE_TAGS = ( new Set(["view", "editor", "quick"]));
|
|
174
|
+
function getInputStateStorageKey(widgetViewKindTag) {
|
|
175
|
+
if (( LEGACY_SHARED_INPUT_STATE_TAGS.has(widgetViewKindTag))) {
|
|
176
|
+
return "chat.untitledInputState";
|
|
185
177
|
}
|
|
178
|
+
return `chat.untitledInputState.${widgetViewKindTag}`;
|
|
179
|
+
}
|
|
180
|
+
function createEmptyInputStateMemento(widgetViewKindTag) {
|
|
181
|
+
return observableMemento({
|
|
182
|
+
defaultValue: undefined,
|
|
183
|
+
key: getInputStateStorageKey(widgetViewKindTag),
|
|
184
|
+
toStorage: serializeUntitledInputState,
|
|
185
|
+
fromStorage(value) {
|
|
186
|
+
const obj = deserializeUntitledInputState(value);
|
|
187
|
+
if (obj.selectedModel && !obj.selectedModel.metadata.isDefaultForLocation) {
|
|
188
|
+
const oldIsDefault = obj.selectedModel.metadata.isDefault;
|
|
189
|
+
const isDefaultForLocation = {
|
|
190
|
+
[ChatAgentLocation.Chat]: Boolean(oldIsDefault)
|
|
191
|
+
};
|
|
192
|
+
mixin(obj.selectedModel.metadata, {
|
|
193
|
+
isDefaultForLocation: isDefaultForLocation
|
|
194
|
+
});
|
|
195
|
+
delete obj.selectedModel.metadata.isDefault;
|
|
196
|
+
}
|
|
197
|
+
return obj;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
const emptyInputAttachments = observableMemento({
|
|
202
|
+
defaultValue: [],
|
|
203
|
+
key: "chat.untitledInputAttachments",
|
|
204
|
+
toStorage: serializeUntitledInputAttachments,
|
|
205
|
+
fromStorage: deserializeUntitledInputAttachments
|
|
186
206
|
});
|
|
187
207
|
let ChatInputPart = class ChatInputPart extends Disposable {
|
|
188
208
|
static {
|
|
@@ -258,11 +278,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
258
278
|
name: mode.name.get(),
|
|
259
279
|
content: modeInstructions.content,
|
|
260
280
|
toolReferences: this.toolService.toToolReferences(modeInstructions.toolReferences),
|
|
281
|
+
allowedSubagents: mode.agents?.get(),
|
|
261
282
|
metadata: modeInstructions.metadata,
|
|
262
283
|
isBuiltin: mode.isBuiltin
|
|
263
284
|
} : undefined,
|
|
264
|
-
|
|
265
|
-
|
|
285
|
+
telemetryModeId: modeId,
|
|
286
|
+
telemetryModeName: getModeNameForTelemetry(mode),
|
|
266
287
|
applyCodeBlockSuggestionId: undefined,
|
|
267
288
|
permissionLevel: this._currentPermissionLevel.get()
|
|
268
289
|
};
|
|
@@ -316,7 +337,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
316
337
|
viewDescriptorService,
|
|
317
338
|
_chatAttachmentWidgetRegistry,
|
|
318
339
|
chatInputNotificationService,
|
|
319
|
-
chatPhoneInputPresenter
|
|
340
|
+
chatPhoneInputPresenter,
|
|
341
|
+
productService
|
|
320
342
|
) {
|
|
321
343
|
super();
|
|
322
344
|
this.location = location;
|
|
@@ -350,6 +372,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
350
372
|
this._chatAttachmentWidgetRegistry = _chatAttachmentWidgetRegistry;
|
|
351
373
|
this.chatInputNotificationService = chatInputNotificationService;
|
|
352
374
|
this.chatPhoneInputPresenter = chatPhoneInputPresenter;
|
|
375
|
+
this.productService = productService;
|
|
353
376
|
this._workingSetCollapsed = observableValue("chatInputPart.workingSetCollapsed", true);
|
|
354
377
|
this._stableInputPartWidth = observableValue("chatInputPart.stableInputPartWidth", 0);
|
|
355
378
|
this._chatInputTodoListWidget = this._register(( new MutableDisposable()));
|
|
@@ -413,8 +436,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
413
436
|
this._renderingChatEdits = this._register(( new MutableDisposable()));
|
|
414
437
|
this._attemptedWorkingSetEntriesCount = 0;
|
|
415
438
|
this._chatSessionIsEmpty = false;
|
|
439
|
+
this._userExplicitlySelectedModel = false;
|
|
416
440
|
this._pendingDelegationTarget = undefined;
|
|
417
441
|
this._currentSessionType = undefined;
|
|
442
|
+
this._modelConfigStore = this._register(( new ChatModelConfigurationStore(
|
|
443
|
+
() => this.getModelConfigurationStorageKey(),
|
|
444
|
+
this.languageModelsService,
|
|
445
|
+
this.storageService
|
|
446
|
+
)));
|
|
418
447
|
this._syncTextDebounced = this._register(( new RunOnceScheduler(() => {
|
|
419
448
|
logChangesToStateModel(
|
|
420
449
|
this._inputModel,
|
|
@@ -426,7 +455,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
426
455
|
this._syncInputStateToModel();
|
|
427
456
|
}, 150)));
|
|
428
457
|
this._emptyInputState = this._register(
|
|
429
|
-
|
|
458
|
+
createEmptyInputStateMemento(this.options.widgetViewKindTag)(StorageScope.WORKSPACE, StorageTarget.USER, this.storageService)
|
|
459
|
+
);
|
|
460
|
+
this._emptyInputAttachments = this._register(
|
|
461
|
+
emptyInputAttachments(StorageScope.WORKSPACE, StorageTarget.USER, this.storageService)
|
|
430
462
|
);
|
|
431
463
|
this._contextResourceLabels = this._register(this.instantiationService.createInstance(ResourceLabels, {
|
|
432
464
|
onDidChangeVisibility: this._onDidChangeVisibility.event
|
|
@@ -458,18 +490,26 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
458
490
|
if (this.options.sessionTypePickerDelegate?.onDidChangeActiveSessionProvider) {
|
|
459
491
|
this._register(
|
|
460
492
|
this.options.sessionTypePickerDelegate.onDidChangeActiveSessionProvider(async newSessionType => {
|
|
493
|
+
this._currentSessionType = newSessionType;
|
|
461
494
|
this.getVisibleOptionGroupsModeAndUpdateContextKeys(this.getCurrentSessionResource());
|
|
462
495
|
this.agentSessionTypeKey.set(newSessionType);
|
|
463
496
|
this.chatSessionSupportsDelegationKey.set(this.chatSessionsService.supportsDelegationForSessionType(newSessionType));
|
|
464
497
|
this.updateWidgetLockStateFromSessionType(newSessionType);
|
|
465
498
|
this.checkModeInSessionPool(newSessionType);
|
|
499
|
+
this.revalidateModelForSessionType();
|
|
466
500
|
this.refreshChatSessionPickers();
|
|
467
501
|
this._notificationWidget.value?.rerender();
|
|
468
502
|
})
|
|
469
503
|
);
|
|
470
504
|
}
|
|
471
505
|
this._attachmentModel = this._register(this.instantiationService.createInstance(ChatAttachmentModel));
|
|
472
|
-
this._register(this._attachmentModel.onDidChange(() =>
|
|
506
|
+
this._register(this._attachmentModel.onDidChange(() => {
|
|
507
|
+
if (this._chatSessionIsEmpty) {
|
|
508
|
+
this._emptyInputAttachments.set(this._attachmentModel.attachments, undefined);
|
|
509
|
+
}
|
|
510
|
+
this._syncInputStateToModel();
|
|
511
|
+
}));
|
|
512
|
+
this._register(this._modelConfigStore.onDidChange(() => this._syncInputStateToModel()));
|
|
473
513
|
this.selectedToolsModel = this._register(
|
|
474
514
|
this.instantiationService.createInstance(ChatSelectedTools, this.currentModeObs, this._currentLanguageModel)
|
|
475
515
|
);
|
|
@@ -478,6 +518,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
478
518
|
);
|
|
479
519
|
this.inputEditorMaxHeight = this.options.renderStyle === "compact" ? INPUT_EDITOR_MAX_HEIGHT / 3 : INPUT_EDITOR_MAX_HEIGHT;
|
|
480
520
|
const padding = this.options.renderStyle === "compact" ? INPUT_EDITOR_PADDING.compact : INPUT_EDITOR_PADDING.default;
|
|
521
|
+
this.singleLineInputEditorHeight = INPUT_EDITOR_LINE_HEIGHT + padding.top + padding.bottom;
|
|
481
522
|
this.inputEditorMinHeight = this.options.inputEditorMinLines ? this.options.inputEditorMinLines * INPUT_EDITOR_LINE_HEIGHT + padding.top + padding.bottom : undefined;
|
|
482
523
|
this.inputEditorHasText = ChatContextKeys.inputHasText.bindTo(contextKeyService);
|
|
483
524
|
this.inputEditorHasSendableContent = ChatContextKeys.inputHasSendableContent.bindTo(contextKeyService);
|
|
@@ -495,6 +536,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
495
536
|
this.chatSessionOptionsValid = ChatContextKeys.chatSessionOptionsValid.bindTo(contextKeyService);
|
|
496
537
|
this.agentSessionTypeKey = ChatContextKeys.agentSessionType.bindTo(contextKeyService);
|
|
497
538
|
this.chatSessionSupportsDelegationKey = ChatContextKeys.chatSessionSupportsDelegation.bindTo(contextKeyService);
|
|
539
|
+
this.chatHasPendingDelegationTargetKey = ChatContextKeys.hasPendingDelegationTarget.bindTo(contextKeyService);
|
|
498
540
|
if (this.options.sessionTypePickerDelegate?.getActiveSessionProvider) {
|
|
499
541
|
const initialSessionType = this.options.sessionTypePickerDelegate.getActiveSessionProvider();
|
|
500
542
|
if (initialSessionType) {
|
|
@@ -519,6 +561,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
519
561
|
this.setPermissionLevel(this.getDefaultPermissionLevel());
|
|
520
562
|
}
|
|
521
563
|
}
|
|
564
|
+
if (e.affectsConfiguration(ChatConfiguration.DefaultModel)) {
|
|
565
|
+
this._applyConfiguredDefaultForEmptySession();
|
|
566
|
+
}
|
|
522
567
|
if (e.affectsConfiguration(AccessibilityVerbositySettingId.Chat)) {
|
|
523
568
|
newOptions.ariaLabel = this._getAriaLabel();
|
|
524
569
|
}
|
|
@@ -546,6 +591,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
546
591
|
));
|
|
547
592
|
this._hasFileAttachmentContextKey = ChatContextKeys.hasFileAttachments.bindTo(contextKeyService);
|
|
548
593
|
this.initSelectedModel();
|
|
594
|
+
this._register(this._onDidChangeCurrentChatMode.event(() => {
|
|
595
|
+
this.checkModelSupported();
|
|
596
|
+
}));
|
|
549
597
|
const resetCurrentLanguageModelIfUnavailable = () => {
|
|
550
598
|
const modelIdentifier = this._currentLanguageModel.get()?.identifier;
|
|
551
599
|
const models = this.getModels();
|
|
@@ -587,9 +635,19 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
587
635
|
this.logService
|
|
588
636
|
);
|
|
589
637
|
}
|
|
638
|
+
if (this._applyConfiguredDefaultForEmptySession()) {
|
|
639
|
+
this._updateInputContentContextKeys();
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
590
642
|
if (shouldResetOnModelListChange(modelIdentifier, models)) {
|
|
591
|
-
this.
|
|
643
|
+
const match = findBestMatchingModel(this._currentLanguageModel.get(), models);
|
|
644
|
+
if (match) {
|
|
645
|
+
this.setCurrentLanguageModel(match);
|
|
646
|
+
} else {
|
|
647
|
+
this.setCurrentLanguageModelToDefault();
|
|
648
|
+
}
|
|
592
649
|
}
|
|
650
|
+
this._updateInputContentContextKeys();
|
|
593
651
|
};
|
|
594
652
|
this._register(
|
|
595
653
|
this.languageModelsService.onDidChangeLanguageModels(resetCurrentLanguageModelIfUnavailable)
|
|
@@ -609,6 +667,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
609
667
|
this._register(autorun(reader => {
|
|
610
668
|
const lm = this._currentLanguageModel.read(reader);
|
|
611
669
|
this.chatModelIdKey.set(lm?.metadata.id.toLowerCase() ?? "");
|
|
670
|
+
this.contextUsageWidget?.setSelectedModel(lm?.identifier);
|
|
612
671
|
if (lm?.metadata.name) {
|
|
613
672
|
this.accessibilityService.alert(lm.metadata.name);
|
|
614
673
|
}
|
|
@@ -626,6 +685,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
626
685
|
const mode = this._currentModeObservable.read(r);
|
|
627
686
|
this.chatModeKindKey.set(mode.kind);
|
|
628
687
|
this.chatModeNameKey.set(mode.name.read(r));
|
|
688
|
+
if (this.options.suppressModePreferredModel) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
629
691
|
const models = mode.model?.read(r);
|
|
630
692
|
if (models) {
|
|
631
693
|
this.switchModelByQualifiedName(models);
|
|
@@ -644,20 +706,24 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
644
706
|
}
|
|
645
707
|
getSelectedModelStorageKey() {
|
|
646
708
|
const sessionType = this._currentSessionType;
|
|
647
|
-
if (sessionType && this.
|
|
709
|
+
if (sessionType && this.sessionTypeHasOwnModelPool(sessionType)) {
|
|
648
710
|
return `chat.currentLanguageModel.${this.location}.${sessionType}`;
|
|
649
711
|
}
|
|
650
712
|
return `chat.currentLanguageModel.${this.location}`;
|
|
651
713
|
}
|
|
652
714
|
getSelectedModelIsDefaultStorageKey() {
|
|
653
715
|
const sessionType = this._currentSessionType;
|
|
654
|
-
if (sessionType && this.
|
|
716
|
+
if (sessionType && this.sessionTypeHasOwnModelPool(sessionType)) {
|
|
655
717
|
return `chat.currentLanguageModel.${this.location}.${sessionType}.isDefault`;
|
|
656
718
|
}
|
|
657
719
|
return `chat.currentLanguageModel.${this.location}.isDefault`;
|
|
658
720
|
}
|
|
721
|
+
sessionTypeHasOwnModelPool(sessionType) {
|
|
722
|
+
return this.chatSessionsService.requiresCustomModelsForSessionType(sessionType) || hasModelsTargetingSession(this.getAllMergedModels(), sessionType);
|
|
723
|
+
}
|
|
659
724
|
initSelectedModel() {
|
|
660
725
|
this._waitForPersistedLanguageModel.clear();
|
|
726
|
+
this._modelConfigStore.clear();
|
|
661
727
|
const selectedModelStorageKey = this.getSelectedModelStorageKey();
|
|
662
728
|
const selectedModelIsDefaultStorageKey = this.getSelectedModelIsDefaultStorageKey();
|
|
663
729
|
const persistedSelection = this.storageService.get(selectedModelStorageKey, StorageScope.APPLICATION);
|
|
@@ -669,6 +735,24 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
669
735
|
undefined,
|
|
670
736
|
this.logService
|
|
671
737
|
);
|
|
738
|
+
const configuredValue = this.getConfiguredModelValue();
|
|
739
|
+
if (configuredValue) {
|
|
740
|
+
const configuredModel = resolveConfiguredModel(configuredValue, this.getModels());
|
|
741
|
+
if (configuredModel) {
|
|
742
|
+
this.setCurrentLanguageModel(configuredModel);
|
|
743
|
+
this.checkModelSupported();
|
|
744
|
+
return;
|
|
745
|
+
}
|
|
746
|
+
this._waitForPersistedLanguageModel.value = this.languageModelsService.onDidChangeLanguageModels(() => {
|
|
747
|
+
const lateModel = resolveConfiguredModel(configuredValue, this.getModels());
|
|
748
|
+
if (lateModel) {
|
|
749
|
+
this._waitForPersistedLanguageModel.clear();
|
|
750
|
+
this.setCurrentLanguageModel(lateModel);
|
|
751
|
+
this.checkModelSupported();
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
672
756
|
if (persistedSelection) {
|
|
673
757
|
const result = shouldRestorePersistedModel(persistedSelection, persistedAsDefault, this.getModels(), this.location);
|
|
674
758
|
logChangesToStateModel(
|
|
@@ -700,9 +784,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
700
784
|
});
|
|
701
785
|
}
|
|
702
786
|
}
|
|
703
|
-
this._register(this._onDidChangeCurrentChatMode.event(() => {
|
|
704
|
-
this.checkModelSupported();
|
|
705
|
-
}));
|
|
706
787
|
}
|
|
707
788
|
setEditing(enabled, editingSentRequest) {
|
|
708
789
|
this.currentlyEditingInputKey?.set(enabled);
|
|
@@ -717,11 +798,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
717
798
|
this.setCurrentLanguageModel(model);
|
|
718
799
|
}
|
|
719
800
|
}
|
|
720
|
-
switchModelByIdentifier(identifier) {
|
|
801
|
+
switchModelByIdentifier(identifier, storeSelection = true) {
|
|
721
802
|
const models = this.getModels();
|
|
722
803
|
const model = models.find(m => m.identifier === identifier);
|
|
723
804
|
if (model) {
|
|
724
|
-
this.setCurrentLanguageModel(model);
|
|
805
|
+
this.setCurrentLanguageModel(model, false, storeSelection);
|
|
725
806
|
return true;
|
|
726
807
|
}
|
|
727
808
|
return false;
|
|
@@ -747,7 +828,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
747
828
|
if (models.length > 0) {
|
|
748
829
|
const currentIndex = models.findIndex(model => model.identifier === this._currentLanguageModel.get()?.identifier);
|
|
749
830
|
const nextIndex = (currentIndex + 1) % models.length;
|
|
750
|
-
this.setCurrentLanguageModel(models[nextIndex]);
|
|
831
|
+
this.setCurrentLanguageModel(models[nextIndex], true);
|
|
751
832
|
}
|
|
752
833
|
}
|
|
753
834
|
switchToNextPinnedModel() {
|
|
@@ -762,7 +843,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
762
843
|
}
|
|
763
844
|
const currentIndex = pinnedModels.findIndex(model => model.identifier === this._currentLanguageModel.get()?.identifier);
|
|
764
845
|
const nextIndex = (currentIndex + 1) % pinnedModels.length;
|
|
765
|
-
this.setCurrentLanguageModel(pinnedModels[nextIndex]);
|
|
846
|
+
this.setCurrentLanguageModel(pinnedModels[nextIndex], true);
|
|
766
847
|
}
|
|
767
848
|
openModelPicker() {
|
|
768
849
|
if (this.chatPhoneInputPresenter.enabled.get()) {
|
|
@@ -794,13 +875,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
794
875
|
setModel: model => {
|
|
795
876
|
this._waitForPersistedLanguageModel.clear();
|
|
796
877
|
this._waitForSessionHistoryLanguageModel.clear();
|
|
797
|
-
this.setCurrentLanguageModel(model);
|
|
878
|
+
this.setCurrentLanguageModel(model, true, !this.options.suppressModelPersistence);
|
|
798
879
|
this.renderAttachedContext();
|
|
799
880
|
},
|
|
800
881
|
getModels: () => this.getModels(),
|
|
882
|
+
isCacheWarm: () => (this._widget?.viewModel?.model.getRequests().length ?? 0) > 0,
|
|
801
883
|
useGroupedModelPicker: () => {
|
|
802
884
|
const sessionType = this.getCurrentSessionType();
|
|
803
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
885
|
+
return !sessionType || sessionType === localChatSessionType || isAgentHostTarget(sessionType);
|
|
804
886
|
},
|
|
805
887
|
showManageModelsAction: () => {
|
|
806
888
|
const sessionType = this.getCurrentSessionType();
|
|
@@ -808,19 +890,51 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
808
890
|
},
|
|
809
891
|
showUnavailableFeatured: () => {
|
|
810
892
|
const sessionType = this.getCurrentSessionType();
|
|
811
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
893
|
+
return !sessionType || sessionType === localChatSessionType || isAgentHostTarget(sessionType);
|
|
812
894
|
},
|
|
813
895
|
showFeatured: () => {
|
|
814
896
|
const sessionType = this.getCurrentSessionType();
|
|
815
|
-
return !sessionType || sessionType === localChatSessionType;
|
|
816
|
-
}
|
|
897
|
+
return !sessionType || sessionType === localChatSessionType || isAgentHostTarget(sessionType);
|
|
898
|
+
},
|
|
899
|
+
showAutoModel: () => this._showAutoModel(),
|
|
900
|
+
modelConfiguration: this._modelConfigStore
|
|
817
901
|
};
|
|
818
902
|
}
|
|
903
|
+
getModelConfiguration(modelId) {
|
|
904
|
+
return this._modelConfigStore.getModelConfiguration(modelId);
|
|
905
|
+
}
|
|
906
|
+
restoreModelConfiguration(modelId, modelConfiguration) {
|
|
907
|
+
if (modelConfiguration) {
|
|
908
|
+
this._modelConfigStore.restoreModelConfiguration(modelId, modelConfiguration);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
getModelConfigurationStorageKey() {
|
|
912
|
+
const sessionType = this._currentSessionType;
|
|
913
|
+
if (sessionType && this.sessionTypeHasOwnModelPool(sessionType)) {
|
|
914
|
+
return `chat.modelConfiguration.${this.location}.${sessionType}`;
|
|
915
|
+
}
|
|
916
|
+
return `chat.modelConfiguration.${this.location}`;
|
|
917
|
+
}
|
|
819
918
|
_createModePickerDelegate() {
|
|
919
|
+
const productService = this.productService;
|
|
920
|
+
const currentChatModes = this.options.hideCustomChatModes ? derived(reader => {
|
|
921
|
+
const inner = this._currentChatModesObservable.read(reader);
|
|
922
|
+
const filteredCustom = inner.custom.filter(m => isModeConsideredBuiltIn(m, productService));
|
|
923
|
+
const wrapped = {
|
|
924
|
+
onDidChange: inner.onDidChange,
|
|
925
|
+
builtin: inner.builtin,
|
|
926
|
+
custom: filteredCustom,
|
|
927
|
+
findModeById: id => inner.builtin.find(m => m.id === id) ?? filteredCustom.find(m => m.id === id),
|
|
928
|
+
findModeByName: name => inner.builtin.find(m => m.name.read(undefined) === name) ?? filteredCustom.find(m => m.name.read(undefined) === name),
|
|
929
|
+
waitForPendingUpdates: () => inner.waitForPendingUpdates()
|
|
930
|
+
};
|
|
931
|
+
return wrapped;
|
|
932
|
+
}) : this._currentChatModesObservable;
|
|
820
933
|
return {
|
|
821
934
|
currentMode: this._currentModeObservable,
|
|
822
|
-
currentChatModes
|
|
935
|
+
currentChatModes,
|
|
823
936
|
sessionResource: () => this._widget?.viewModel?.sessionResource,
|
|
937
|
+
setMode: mode => this.setChatMode2(mode, true),
|
|
824
938
|
customAgentTarget: () => {
|
|
825
939
|
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
826
940
|
return (sessionResource && this.chatSessionsService.getCustomAgentTargetForSessionType(getChatSessionType(sessionResource))) ?? Target.Undefined;
|
|
@@ -941,7 +1055,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
941
1055
|
this._currentChatModesObservable.set(chatModes, undefined);
|
|
942
1056
|
this.selectedToolsModel.resetSessionEnablementState();
|
|
943
1057
|
this._chatSessionIsEmpty = chatSessionIsEmpty;
|
|
1058
|
+
this._userExplicitlySelectedModel = false;
|
|
944
1059
|
if (chatSessionIsEmpty) {
|
|
1060
|
+
const persistedState = model.state.get() ? undefined : this._getPersistedEmptyInputState();
|
|
1061
|
+
if (persistedState) {
|
|
1062
|
+
model.setState(persistedState);
|
|
1063
|
+
this._syncFromModel(persistedState, forSessionResource);
|
|
1064
|
+
}
|
|
945
1065
|
logChangesToStateModel(this._inputModel, `(1) setting empty model state for ${( forSessionResource.toString())}`, undefined, undefined, this.logService);
|
|
946
1066
|
this._setEmptyModelState();
|
|
947
1067
|
this._modelSyncDisposables.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
@@ -970,8 +1090,26 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
970
1090
|
let state = model.state.read(reader);
|
|
971
1091
|
let message = `syncing from model for ${( forSessionResource.toString())} in ${this._currentSessionKey}`;
|
|
972
1092
|
if (!state && this._chatSessionIsEmpty) {
|
|
973
|
-
state = this.
|
|
1093
|
+
state = this._getPersistedEmptyInputState();
|
|
974
1094
|
message = `syncing from empty input state for ${( forSessionResource.toString())}`;
|
|
1095
|
+
if (state && this.getConfiguredModelValue()) {
|
|
1096
|
+
const configuredModel = this.getConfiguredDefaultModel(this.getModels());
|
|
1097
|
+
if (configuredModel) {
|
|
1098
|
+
if (configuredModel.identifier !== state.selectedModel?.identifier) {
|
|
1099
|
+
state = {
|
|
1100
|
+
...state,
|
|
1101
|
+
selectedModel: configuredModel,
|
|
1102
|
+
modelConfiguration: undefined
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
} else if (state.selectedModel) {
|
|
1106
|
+
state = {
|
|
1107
|
+
...state,
|
|
1108
|
+
selectedModel: undefined,
|
|
1109
|
+
modelConfiguration: undefined
|
|
1110
|
+
};
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
975
1113
|
}
|
|
976
1114
|
const widgetSessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
977
1115
|
const isStaleSession = !!this._inputModelSessionResource && !isEqual(this._inputModelSessionResource, forSessionResource);
|
|
@@ -986,6 +1124,36 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
986
1124
|
this._syncFromModel(state, forSessionResource);
|
|
987
1125
|
}));
|
|
988
1126
|
}
|
|
1127
|
+
_getPersistedEmptyInputState() {
|
|
1128
|
+
let state = this._emptyInputState.read(undefined);
|
|
1129
|
+
if (!state) {
|
|
1130
|
+
return undefined;
|
|
1131
|
+
}
|
|
1132
|
+
const persistedAttachments = this._emptyInputAttachments.read(undefined);
|
|
1133
|
+
state = {
|
|
1134
|
+
...state,
|
|
1135
|
+
attachments: persistedAttachments.length > 0 ? persistedAttachments : state.attachments
|
|
1136
|
+
};
|
|
1137
|
+
if (this.getConfiguredModelValue()) {
|
|
1138
|
+
const configuredModel = this.getConfiguredDefaultModel(this.getModels());
|
|
1139
|
+
if (configuredModel) {
|
|
1140
|
+
if (configuredModel.identifier !== state.selectedModel?.identifier) {
|
|
1141
|
+
state = {
|
|
1142
|
+
...state,
|
|
1143
|
+
selectedModel: configuredModel,
|
|
1144
|
+
modelConfiguration: undefined
|
|
1145
|
+
};
|
|
1146
|
+
}
|
|
1147
|
+
} else if (state.selectedModel) {
|
|
1148
|
+
state = {
|
|
1149
|
+
...state,
|
|
1150
|
+
selectedModel: undefined,
|
|
1151
|
+
modelConfiguration: undefined
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return state;
|
|
1156
|
+
}
|
|
989
1157
|
_setEmptyModelState() {
|
|
990
1158
|
logChangesToStateModel(
|
|
991
1159
|
this._inputModel,
|
|
@@ -1049,9 +1217,20 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1049
1217
|
this.logService
|
|
1050
1218
|
);
|
|
1051
1219
|
if (syncResult.action === "apply") {
|
|
1220
|
+
this._waitForPersistedLanguageModel.clear();
|
|
1221
|
+
this.restoreModelConfiguration(state.selectedModel.identifier, state.modelConfiguration);
|
|
1052
1222
|
this.setCurrentLanguageModel(state.selectedModel);
|
|
1223
|
+
} else if (syncResult.action === "keep") {
|
|
1224
|
+
this._waitForPersistedLanguageModel.clear();
|
|
1225
|
+
this.restoreModelConfiguration(state.selectedModel.identifier, state.modelConfiguration);
|
|
1053
1226
|
} else if (syncResult.action === "default") {
|
|
1054
|
-
this.
|
|
1227
|
+
const pool = this.getModelsForSessionType(sessionType);
|
|
1228
|
+
const match = findBestMatchingModel(state.selectedModel, pool) ?? findBestMatchingModel(currentLm, pool);
|
|
1229
|
+
if (match) {
|
|
1230
|
+
this.setCurrentLanguageModel(match);
|
|
1231
|
+
} else {
|
|
1232
|
+
this.setCurrentLanguageModelToDefault(sessionType);
|
|
1233
|
+
}
|
|
1055
1234
|
}
|
|
1056
1235
|
} else if (state) {
|
|
1057
1236
|
logChangesToStateModel(
|
|
@@ -1117,13 +1296,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1117
1296
|
this._syncInputStateToModel();
|
|
1118
1297
|
}
|
|
1119
1298
|
}
|
|
1120
|
-
setCurrentLanguageModel(model) {
|
|
1299
|
+
setCurrentLanguageModel(model, isUserAction = false, storeSelection = true) {
|
|
1300
|
+
if (isUserAction) {
|
|
1301
|
+
this._userExplicitlySelectedModel = true;
|
|
1302
|
+
}
|
|
1121
1303
|
const modelDetails = ( this.getModels().map(m => `${m.identifier} (${m.metadata.id})`)).join(", ");
|
|
1122
1304
|
const selectedModelStorageKey = this.getSelectedModelStorageKey();
|
|
1123
1305
|
const selectedModelIsDefaultStorageKey = this.getSelectedModelIsDefaultStorageKey();
|
|
1124
1306
|
logChangesToStateModel(
|
|
1125
1307
|
this._inputModel,
|
|
1126
|
-
`setCurrentLanguageModel to ${model.identifier} in ${this._currentSessionKey}, storageKey=${selectedModelStorageKey}, isDefaultKey=${selectedModelIsDefaultStorageKey}, currentSessionType=${this._currentSessionType}, getCurrentSessionType=${this.getCurrentSessionType()}, boundInputModelSession=${this._inputModelSessionResource?.toString()}, modelDetials = ${modelDetails}`,
|
|
1308
|
+
`setCurrentLanguageModel to ${model.identifier} in ${this._currentSessionKey}, storageKey=${selectedModelStorageKey}, isDefaultKey=${selectedModelIsDefaultStorageKey}, currentSessionType=${this._currentSessionType}, getCurrentSessionType=${this.getCurrentSessionType()}, boundInputModelSession=${this._inputModelSessionResource?.toString()}, modelDetials = ${modelDetails}, storeSelection=${storeSelection}`,
|
|
1127
1309
|
undefined,
|
|
1128
1310
|
undefined,
|
|
1129
1311
|
this.logService
|
|
@@ -1132,18 +1314,20 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1132
1314
|
if (this.cachedWidth) {
|
|
1133
1315
|
this.layout(this.cachedWidth);
|
|
1134
1316
|
}
|
|
1135
|
-
|
|
1136
|
-
this.
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
this.
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1317
|
+
if (storeSelection) {
|
|
1318
|
+
this.storageService.store(
|
|
1319
|
+
this.getSelectedModelStorageKey(),
|
|
1320
|
+
model.identifier,
|
|
1321
|
+
StorageScope.APPLICATION,
|
|
1322
|
+
StorageTarget.USER
|
|
1323
|
+
);
|
|
1324
|
+
this.storageService.store(
|
|
1325
|
+
this.getSelectedModelIsDefaultStorageKey(),
|
|
1326
|
+
!!model.metadata.isDefaultForLocation[this.location],
|
|
1327
|
+
StorageScope.APPLICATION,
|
|
1328
|
+
StorageTarget.USER
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1147
1331
|
this._syncInputStateToModel();
|
|
1148
1332
|
}
|
|
1149
1333
|
checkModelSupported() {
|
|
@@ -1166,7 +1350,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1166
1350
|
currentModeKind: this.currentModeKind,
|
|
1167
1351
|
sessionType: this.getCurrentSessionType()
|
|
1168
1352
|
}, allModels)) {
|
|
1169
|
-
this.setCurrentLanguageModelToDefault();
|
|
1353
|
+
this.setCurrentLanguageModelToDefault(undefined, !this.options.suppressModelPersistence);
|
|
1170
1354
|
}
|
|
1171
1355
|
}
|
|
1172
1356
|
setChatMode(mode, storeSelection = true) {
|
|
@@ -1183,14 +1367,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1183
1367
|
}
|
|
1184
1368
|
this._currentModeObservable.set(mode, undefined);
|
|
1185
1369
|
this._onDidChangeCurrentChatMode.fire();
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1370
|
+
if (storeSelection) {
|
|
1371
|
+
logChangesToStateModel(
|
|
1372
|
+
this._inputModel,
|
|
1373
|
+
`setChatMode2 -> _syncInputStateToModel (mode=${mode.id}, storeSelection=${storeSelection}, currentLanguageModel=${this._currentLanguageModel.get()?.identifier}) in ${this._currentSessionKey}`,
|
|
1374
|
+
undefined,
|
|
1375
|
+
undefined,
|
|
1376
|
+
this.logService
|
|
1377
|
+
);
|
|
1378
|
+
this._syncInputStateToModel();
|
|
1379
|
+
}
|
|
1194
1380
|
}
|
|
1195
1381
|
getAllMergedModels() {
|
|
1196
1382
|
const cachedModels = this.storageService.getObject(CachedLanguageModelsKey, StorageScope.APPLICATION, []);
|
|
@@ -1217,21 +1403,33 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1217
1403
|
return models;
|
|
1218
1404
|
}
|
|
1219
1405
|
getModels() {
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1406
|
+
return this.getModelsForSessionType(this.getCurrentSessionType());
|
|
1407
|
+
}
|
|
1408
|
+
_showAutoModel() {
|
|
1409
|
+
const sessionType = this.getCurrentSessionType();
|
|
1410
|
+
return !sessionType || this.chatSessionsService.supportsAutoModelForSessionType(sessionType);
|
|
1411
|
+
}
|
|
1412
|
+
hasNoAvailableModel() {
|
|
1413
|
+
return !this._showAutoModel() && this.getModels().length === 0;
|
|
1414
|
+
}
|
|
1415
|
+
getModelsForSessionType(sessionType) {
|
|
1416
|
+
const allModels = this.getAllMergedModels();
|
|
1417
|
+
if (sessionType && this.chatSessionsService.requiresCustomModelsForSessionType(sessionType) && !hasModelsTargetingSession(allModels, sessionType)) {
|
|
1418
|
+
return [];
|
|
1419
|
+
}
|
|
1420
|
+
allModels.sort((a, b) => a.metadata.name.localeCompare(b.metadata.name));
|
|
1421
|
+
const sessionFiltered = filterModelsForSession(allModels, sessionType, this.currentModeKind, this.location);
|
|
1223
1422
|
return sessionFiltered.filter(m => !this.languageModelsService.isModelHidden(m.identifier));
|
|
1224
1423
|
}
|
|
1225
1424
|
getCurrentSessionType() {
|
|
1226
|
-
const delegateSessionType = this.options.sessionTypePickerDelegate?.getActiveSessionProvider?.();
|
|
1227
|
-
if (delegateSessionType) {
|
|
1228
|
-
return delegateSessionType;
|
|
1229
|
-
}
|
|
1230
1425
|
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
1231
|
-
|
|
1426
|
+
if (sessionResource) {
|
|
1427
|
+
return getChatSessionType(sessionResource);
|
|
1428
|
+
}
|
|
1429
|
+
return this.options.sessionTypePickerDelegate?.getActiveSessionProvider?.();
|
|
1232
1430
|
}
|
|
1233
|
-
|
|
1234
|
-
return
|
|
1431
|
+
getNotificationSessionType() {
|
|
1432
|
+
return this._pendingDelegationTarget ?? this._currentSessionType ?? this.getCurrentSessionType();
|
|
1235
1433
|
}
|
|
1236
1434
|
isModelValidForCurrentSession(model) {
|
|
1237
1435
|
return isModelValidForSession(model, this.getAllMergedModels(), this.getCurrentSessionType());
|
|
@@ -1242,6 +1440,20 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1242
1440
|
this.setCurrentLanguageModelToDefault();
|
|
1243
1441
|
}
|
|
1244
1442
|
}
|
|
1443
|
+
revalidateModelForSessionType() {
|
|
1444
|
+
const previousModel = this._currentLanguageModel.get();
|
|
1445
|
+
this.initSelectedModel();
|
|
1446
|
+
const restored = this._currentLanguageModel.get();
|
|
1447
|
+
if (restored && this.isModelValidForCurrentSession(restored)) {
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1450
|
+
const match = findBestMatchingModel(previousModel, this.getModels());
|
|
1451
|
+
if (match) {
|
|
1452
|
+
this.setCurrentLanguageModel(match);
|
|
1453
|
+
return;
|
|
1454
|
+
}
|
|
1455
|
+
this.setCurrentLanguageModelToDefault();
|
|
1456
|
+
}
|
|
1245
1457
|
checkModeInSessionPool(sessionType) {
|
|
1246
1458
|
if (!sessionType) {
|
|
1247
1459
|
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
@@ -1318,22 +1530,56 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1318
1530
|
}
|
|
1319
1531
|
});
|
|
1320
1532
|
}
|
|
1321
|
-
setCurrentLanguageModelToDefault() {
|
|
1322
|
-
const
|
|
1323
|
-
|
|
1533
|
+
setCurrentLanguageModelToDefault(forSessionType, storeSelection = true) {
|
|
1534
|
+
const sessionType = forSessionType ?? this.getCurrentSessionType();
|
|
1535
|
+
if (sessionType && this.chatSessionsService.requiresCustomModelsForSessionType(sessionType) && !hasModelsTargetingSession(this.getAllMergedModels(), sessionType)) {
|
|
1536
|
+
return;
|
|
1537
|
+
}
|
|
1538
|
+
const allModels = this.getModelsForSessionType(sessionType);
|
|
1539
|
+
const configuredModel = this.getConfiguredDefaultModel(allModels);
|
|
1540
|
+
const defaultModel = configuredModel ?? findDefaultModel(allModels, this.location);
|
|
1324
1541
|
logChangesToStateModel(
|
|
1325
1542
|
this._inputModel,
|
|
1326
|
-
`[DEFAULT] setCurrentLanguageModelToDefault called (defaultModel=${defaultModel?.identifier}, currentLm=${this._currentLanguageModel.get()?.identifier}) in ${this._currentSessionKey}`,
|
|
1543
|
+
`[DEFAULT] setCurrentLanguageModelToDefault called (defaultModel=${defaultModel?.identifier}, configuredModel=${configuredModel?.identifier}, currentLm=${this._currentLanguageModel.get()?.identifier}, storeSelection=${storeSelection}) in ${this._currentSessionKey}`,
|
|
1327
1544
|
undefined,
|
|
1328
1545
|
this._inputModel?.state.get(),
|
|
1329
1546
|
this.logService
|
|
1330
1547
|
);
|
|
1331
1548
|
if (defaultModel) {
|
|
1332
|
-
this.setCurrentLanguageModel(defaultModel);
|
|
1549
|
+
this.setCurrentLanguageModel(defaultModel, false, storeSelection);
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
getConfiguredDefaultModel(pool) {
|
|
1553
|
+
return resolveConfiguredModel(this.getConfiguredModelValue(), pool);
|
|
1554
|
+
}
|
|
1555
|
+
getConfiguredModelValue() {
|
|
1556
|
+
const model = this.configurationService.getValue(ChatConfiguration.DefaultModel)?.trim();
|
|
1557
|
+
return model ? model : undefined;
|
|
1558
|
+
}
|
|
1559
|
+
_applyConfiguredDefaultForEmptySession() {
|
|
1560
|
+
if (!this._chatSessionIsEmpty || this._userExplicitlySelectedModel) {
|
|
1561
|
+
return false;
|
|
1562
|
+
}
|
|
1563
|
+
const configuredValue = this.getConfiguredModelValue();
|
|
1564
|
+
if (!configuredValue) {
|
|
1565
|
+
return false;
|
|
1566
|
+
}
|
|
1567
|
+
const configuredModel = this.getConfiguredDefaultModel(this.getModels());
|
|
1568
|
+
if (!configuredModel || configuredModel.identifier === this._currentLanguageModel.get()?.identifier) {
|
|
1569
|
+
return false;
|
|
1333
1570
|
}
|
|
1571
|
+
this._waitForPersistedLanguageModel.clear();
|
|
1572
|
+
this.setCurrentLanguageModel(configuredModel);
|
|
1573
|
+
this.checkModelSupported();
|
|
1574
|
+
return true;
|
|
1575
|
+
}
|
|
1576
|
+
resetLanguageModelToDefault(storeSelection = true) {
|
|
1577
|
+
this._waitForPersistedLanguageModel.clear();
|
|
1578
|
+
this.setCurrentLanguageModelToDefault(undefined, storeSelection);
|
|
1334
1579
|
}
|
|
1335
1580
|
getCurrentInputState() {
|
|
1336
1581
|
const mode = this._currentModeObservable.get();
|
|
1582
|
+
const selectedModel = this._currentLanguageModel.get();
|
|
1337
1583
|
const state = {
|
|
1338
1584
|
inputText: this._inputEditor?.getValue() ?? "",
|
|
1339
1585
|
attachments: this._attachmentModel.attachments,
|
|
@@ -1341,7 +1587,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1341
1587
|
id: mode.id,
|
|
1342
1588
|
kind: mode.kind
|
|
1343
1589
|
},
|
|
1344
|
-
selectedModel
|
|
1590
|
+
selectedModel,
|
|
1591
|
+
modelConfiguration: selectedModel ? this._modelConfigStore.getModelConfiguration(selectedModel.identifier) : undefined,
|
|
1345
1592
|
selections: this._inputEditor?.getSelections() || [],
|
|
1346
1593
|
permissionLevel: this._currentPermissionLevel.get(),
|
|
1347
1594
|
contrib: {}
|
|
@@ -1359,40 +1606,40 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1359
1606
|
}
|
|
1360
1607
|
const mode = this._currentModeObservable.get();
|
|
1361
1608
|
const modelName = this._currentLanguageModel.get()?.metadata.name;
|
|
1362
|
-
const modelInfo = modelName ? ( localize(
|
|
1609
|
+
const modelInfo = modelName ? ( localize(8243, ", {0}. ", modelName)) : "";
|
|
1363
1610
|
let modeLabel = "";
|
|
1364
1611
|
if (!mode.isBuiltin) {
|
|
1365
1612
|
const mode = this.currentModeObs.get();
|
|
1366
|
-
modeLabel = ( localize(
|
|
1613
|
+
modeLabel = ( localize(8244, "({0}), {1}", mode.label.get(), mode.description.get()));
|
|
1367
1614
|
} else {
|
|
1368
1615
|
switch (this.currentModeKind) {
|
|
1369
1616
|
case ChatModeKind.Agent:
|
|
1370
|
-
modeLabel = ( localize(
|
|
1617
|
+
modeLabel = ( localize(8245, "(Agent), edit files in your workspace."));
|
|
1371
1618
|
break;
|
|
1372
1619
|
case ChatModeKind.Edit:
|
|
1373
|
-
modeLabel = ( localize(
|
|
1620
|
+
modeLabel = ( localize(8246, "(Edit), edit files in your workspace."));
|
|
1374
1621
|
break;
|
|
1375
1622
|
case ChatModeKind.Ask:
|
|
1376
1623
|
default:
|
|
1377
|
-
modeLabel = ( localize(
|
|
1624
|
+
modeLabel = ( localize(8247, "(Ask), ask questions or type / for topics."));
|
|
1378
1625
|
break;
|
|
1379
1626
|
}
|
|
1380
1627
|
}
|
|
1381
1628
|
if (verbose) {
|
|
1382
1629
|
return kbLabel ? ( localize(
|
|
1383
|
-
|
|
1630
|
+
8248,
|
|
1384
1631
|
"Chat Input {0}{1} Press Enter to send out the request. Use {2} for Chat Accessibility Help.",
|
|
1385
1632
|
modeLabel,
|
|
1386
1633
|
modelInfo,
|
|
1387
1634
|
kbLabel
|
|
1388
1635
|
)) : ( localize(
|
|
1389
|
-
|
|
1636
|
+
8249,
|
|
1390
1637
|
"Chat Input {0}{1} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.",
|
|
1391
1638
|
modeLabel,
|
|
1392
1639
|
modelInfo
|
|
1393
1640
|
));
|
|
1394
1641
|
} else {
|
|
1395
|
-
return localize(
|
|
1642
|
+
return localize(8250, "Chat Input {0}{1}.", modeLabel, modelInfo);
|
|
1396
1643
|
}
|
|
1397
1644
|
}
|
|
1398
1645
|
validateCurrentChatMode() {
|
|
@@ -1531,7 +1778,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1531
1778
|
hasVisibleTodos() {
|
|
1532
1779
|
return this._chatInputTodoListWidget.value?.hasTodos() ?? false;
|
|
1533
1780
|
}
|
|
1534
|
-
async acceptInput(isUserQuery) {
|
|
1781
|
+
async acceptInput(isUserQuery, preserveFocus) {
|
|
1535
1782
|
if (isUserQuery) {
|
|
1536
1783
|
const userQuery = this.getCurrentInputState();
|
|
1537
1784
|
this.history.append(this._getFilteredEntry(userQuery));
|
|
@@ -1541,6 +1788,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1541
1788
|
if (this._chatSessionIsEmpty) {
|
|
1542
1789
|
this._chatSessionIsEmpty = false;
|
|
1543
1790
|
this._emptyInputState.set(undefined, undefined);
|
|
1791
|
+
this._emptyInputAttachments.set([], undefined);
|
|
1544
1792
|
}
|
|
1545
1793
|
logChangesToStateModel(
|
|
1546
1794
|
this._inputModel,
|
|
@@ -1553,6 +1801,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1553
1801
|
this._onDidLoadInputState.fire();
|
|
1554
1802
|
if (this.accessibilityService.isScreenReaderOptimized() && isMacintosh) {
|
|
1555
1803
|
this._acceptInputForVoiceover();
|
|
1804
|
+
} else if (preserveFocus) {
|
|
1805
|
+
this._inputEditor.setValue("");
|
|
1556
1806
|
} else {
|
|
1557
1807
|
this._inputEditor.focus();
|
|
1558
1808
|
this._inputEditor.setValue("");
|
|
@@ -1597,7 +1847,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1597
1847
|
_updateInputContentContextKeys() {
|
|
1598
1848
|
const inputHasText = !!this._inputEditor?.getModel()?.getValue().trim();
|
|
1599
1849
|
this.inputEditorHasText.set(inputHasText);
|
|
1600
|
-
|
|
1850
|
+
const hasSendableContent = inputHasText || ( this._attachmentModel.attachments.some(isExplicitFileOrImageVariableEntry));
|
|
1851
|
+
this.inputEditorHasSendableContent.set(hasSendableContent && !this.hasNoAvailableModel());
|
|
1601
1852
|
}
|
|
1602
1853
|
getOrCreateOptionEmitter(optionGroupId) {
|
|
1603
1854
|
let emitter = this._chatSessionOptionEmitters.get(optionGroupId);
|
|
@@ -1649,11 +1900,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1649
1900
|
if (!visibleOptionGroups.length) {
|
|
1650
1901
|
this.chatSessionHasOptions.set(false);
|
|
1651
1902
|
this.chatSessionOptionsValid.set(true);
|
|
1903
|
+
this._updateInputContentContextKeys();
|
|
1652
1904
|
return [];
|
|
1653
1905
|
}
|
|
1654
1906
|
const allOptionsValid = sessionResource ? this.areAllOptionsValid(sessionResource, visibleOptionGroups) : true;
|
|
1655
1907
|
this.chatSessionHasOptions.set(true);
|
|
1656
1908
|
this.chatSessionOptionsValid.set(allOptionsValid);
|
|
1909
|
+
this._updateInputContentContextKeys();
|
|
1657
1910
|
return visibleOptionGroups;
|
|
1658
1911
|
}
|
|
1659
1912
|
getCurrentSessionResource() {
|
|
@@ -1815,17 +2068,36 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1815
2068
|
}
|
|
1816
2069
|
const contribution = this.chatSessionsService.getChatSessionContribution(sessionType);
|
|
1817
2070
|
if (contribution) {
|
|
1818
|
-
this._widget?.lockToCodingAgent(
|
|
2071
|
+
this._widget?.lockToCodingAgent(
|
|
2072
|
+
contribution.name,
|
|
2073
|
+
contribution.displayName,
|
|
2074
|
+
contribution.type,
|
|
2075
|
+
contribution.agentHostProviderId
|
|
2076
|
+
);
|
|
1819
2077
|
} else {
|
|
1820
2078
|
this._widget?.unlockFromCodingAgent();
|
|
1821
2079
|
}
|
|
1822
2080
|
}
|
|
2081
|
+
getActiveSessionTypeForDelegation() {
|
|
2082
|
+
const sessionResource = this._widget?.viewModel?.sessionResource;
|
|
2083
|
+
return sessionResource ? (getAgentSessionProvider(sessionResource) ?? getChatSessionType(sessionResource)) : undefined;
|
|
2084
|
+
}
|
|
2085
|
+
continueInSession(provider) {
|
|
2086
|
+
this.setPendingDelegationTarget(provider);
|
|
2087
|
+
this.focus();
|
|
2088
|
+
}
|
|
2089
|
+
setPendingDelegationTarget(provider) {
|
|
2090
|
+
const isActive = this.getActiveSessionTypeForDelegation() === provider;
|
|
2091
|
+
this._pendingDelegationTarget = isActive ? undefined : provider;
|
|
2092
|
+
this.chatHasPendingDelegationTargetKey.set(!!this._pendingDelegationTarget);
|
|
2093
|
+
this.updateWidgetLockStateFromSessionType(provider);
|
|
2094
|
+
this.updateAgentSessionTypeContextKey();
|
|
2095
|
+
this.refreshChatSessionPickers();
|
|
2096
|
+
this._notificationWidget.value?.rerender();
|
|
2097
|
+
}
|
|
1823
2098
|
ensureNotificationWidget() {
|
|
1824
2099
|
if (!this._notificationWidget.value) {
|
|
1825
|
-
this._notificationWidget.value = this.instantiationService.createInstance(
|
|
1826
|
-
ChatInputNotificationWidget,
|
|
1827
|
-
() => this._currentSessionType ?? this.getCurrentSessionType()
|
|
1828
|
-
);
|
|
2100
|
+
this._notificationWidget.value = this.instantiationService.createInstance(ChatInputNotificationWidget, () => this.getNotificationSessionType());
|
|
1829
2101
|
this.chatInputNotificationContainer.appendChild(this._notificationWidget.value.domNode);
|
|
1830
2102
|
}
|
|
1831
2103
|
}
|
|
@@ -1860,10 +2132,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1860
2132
|
this._contextUsageDisposables.value = store;
|
|
1861
2133
|
store.add(model.onDidChange(e => {
|
|
1862
2134
|
if (e.kind === "addRequest" || e.kind === "completedRequest") {
|
|
1863
|
-
this.contextUsageWidget?.update(model.lastRequest);
|
|
2135
|
+
this.contextUsageWidget?.update(model.lastRequest, model.sessionCost);
|
|
1864
2136
|
}
|
|
1865
2137
|
}));
|
|
1866
|
-
this.
|
|
2138
|
+
store.add(this.languageModelsService.onDidChangeLanguageModels(() => {
|
|
2139
|
+
const lastRequest = model.lastRequest;
|
|
2140
|
+
if (lastRequest?.modelId) {
|
|
2141
|
+
this.contextUsageWidget?.update(lastRequest, model.sessionCost);
|
|
2142
|
+
}
|
|
2143
|
+
}));
|
|
2144
|
+
this.contextUsageWidget.update(model.lastRequest, model.sessionCost);
|
|
1867
2145
|
}
|
|
1868
2146
|
render(container, initialValue, widget) {
|
|
1869
2147
|
this._widget = widget;
|
|
@@ -1877,6 +2155,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1877
2155
|
}
|
|
1878
2156
|
this._register(widget.onDidChangeViewModel(e => {
|
|
1879
2157
|
this._pendingDelegationTarget = undefined;
|
|
2158
|
+
this.chatHasPendingDelegationTargetKey.set(false);
|
|
1880
2159
|
this.updateAgentSessionTypeContextKey();
|
|
1881
2160
|
this.refreshChatSessionPickers();
|
|
1882
2161
|
this.ensureNotificationWidget();
|
|
@@ -2021,10 +2300,16 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2021
2300
|
this.chatGoalBannerContainer = elements.chatGoalBannerContainer;
|
|
2022
2301
|
this.contextUsageWidgetContainer = elements.contextUsageWidgetContainer;
|
|
2023
2302
|
this.statusToolbarContainer = elements.statusToolbarContainer;
|
|
2024
|
-
if (this.options.
|
|
2303
|
+
if (this.options.renderStyle === "compact") {
|
|
2025
2304
|
toolbarsContainer.prepend(this.contextUsageWidgetContainer);
|
|
2026
2305
|
}
|
|
2027
2306
|
this.contextUsageWidget = this._register(this.instantiationService.createInstance(ChatContextUsageWidget));
|
|
2307
|
+
this.contextUsageWidget.setChatWidget(widget);
|
|
2308
|
+
this.contextUsageWidget.setSelectedModel(this._currentLanguageModel.get()?.identifier);
|
|
2309
|
+
this.contextUsageWidget.setModelConfigurationResolver(
|
|
2310
|
+
modelId => this.getModelConfiguration(modelId),
|
|
2311
|
+
this._modelConfigStore.onDidChange
|
|
2312
|
+
);
|
|
2028
2313
|
this.contextUsageWidgetContainer.appendChild(this.contextUsageWidget.domNode);
|
|
2029
2314
|
if (this.options.enableImplicitContext && !this._implicitContext) {
|
|
2030
2315
|
this._implicitContext = this._register(this.instantiationService.createInstance(ChatImplicitContexts));
|
|
@@ -2106,7 +2391,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2106
2391
|
DropIntoEditorController.ID,
|
|
2107
2392
|
CopyPasteController.ID,
|
|
2108
2393
|
LinkDetector.ID,
|
|
2109
|
-
InlineCompletionsController.ID
|
|
2394
|
+
InlineCompletionsController.ID,
|
|
2395
|
+
PlaceholderTextContribution.ID
|
|
2110
2396
|
]));
|
|
2111
2397
|
this._inputEditor = this._register(
|
|
2112
2398
|
scopedInstantiationService.createInstance(CodeEditorWidget, this._inputEditorElement, options, editorOptions)
|
|
@@ -2249,24 +2535,26 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2249
2535
|
} else if (action.id === OpenModePickerAction.ID && action instanceof MenuItemAction) {
|
|
2250
2536
|
const delegate = this._createModePickerDelegate();
|
|
2251
2537
|
return this.modeWidget = this.instantiationService.createInstance(ModePickerActionItem, action, delegate, pickerOptions);
|
|
2538
|
+
} else if (action.id === OpenAutomationsWorkspacePickerAction.ID && action instanceof MenuItemAction) {
|
|
2539
|
+
if (this.options.workspacePickerInput) {
|
|
2540
|
+
return this.instantiationService.createInstance(
|
|
2541
|
+
WorkspacePickerInputActionItem,
|
|
2542
|
+
action,
|
|
2543
|
+
this.options.workspacePickerInput,
|
|
2544
|
+
undefined
|
|
2545
|
+
);
|
|
2546
|
+
}
|
|
2547
|
+
return ( new HiddenActionViewItem(action));
|
|
2252
2548
|
} else if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
2253
|
-
const getActiveSessionType = () => {
|
|
2254
|
-
const sessionResource = this._widget?.viewModel?.sessionResource;
|
|
2255
|
-
return sessionResource ? (getAgentSessionProvider(sessionResource) ?? getChatSessionType(sessionResource)) : undefined;
|
|
2256
|
-
};
|
|
2257
2549
|
const delegate = this.options.sessionTypePickerDelegate ?? {
|
|
2258
2550
|
getActiveSessionProvider: () => {
|
|
2259
|
-
return
|
|
2551
|
+
return this.getActiveSessionTypeForDelegation();
|
|
2260
2552
|
},
|
|
2261
2553
|
getPendingDelegationTarget: () => {
|
|
2262
2554
|
return this._pendingDelegationTarget;
|
|
2263
2555
|
},
|
|
2264
2556
|
setPendingDelegationTarget: provider => {
|
|
2265
|
-
|
|
2266
|
-
this._pendingDelegationTarget = isActive ? undefined : provider;
|
|
2267
|
-
this.updateWidgetLockStateFromSessionType(provider);
|
|
2268
|
-
this.updateAgentSessionTypeContextKey();
|
|
2269
|
-
this.refreshChatSessionPickers();
|
|
2557
|
+
this.setPendingDelegationTarget(provider);
|
|
2270
2558
|
},
|
|
2271
2559
|
hasGitRepository: () => this.hasWorkspaceScmRepository()
|
|
2272
2560
|
};
|
|
@@ -2361,6 +2649,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2361
2649
|
[OpenAgentHostModePickerAction.ID, 22],
|
|
2362
2650
|
[OpenAgentHostAutoApprovePickerAction.ID, 22],
|
|
2363
2651
|
[OpenAgentHostPermissionModePickerAction.ID, 22],
|
|
2652
|
+
[OpenAgentHostFolderPickerAction.ID, 22],
|
|
2364
2653
|
["sessions.tunnelHost.toggleSharing", 16]
|
|
2365
2654
|
]));
|
|
2366
2655
|
const genericChipsContainer = $$1(".chat-secondary-generic-chips");
|
|
@@ -2387,24 +2676,20 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2387
2676
|
getActionMinWidth: action => agentHostShortPickerMinWidths.get(action.id)
|
|
2388
2677
|
},
|
|
2389
2678
|
actionViewItemProvider: (action, options) => {
|
|
2679
|
+
const customSecondaryItem = this.options.secondaryToolbarActionViewItemProvider?.(action, options);
|
|
2680
|
+
if (customSecondaryItem) {
|
|
2681
|
+
return customSecondaryItem;
|
|
2682
|
+
}
|
|
2390
2683
|
if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
2391
|
-
const getActiveSessionType = () => {
|
|
2392
|
-
const sessionResource = this._widget?.viewModel?.sessionResource;
|
|
2393
|
-
return sessionResource ? (getAgentSessionProvider(sessionResource) ?? getChatSessionType(sessionResource)) : undefined;
|
|
2394
|
-
};
|
|
2395
2684
|
const delegate = this.options.sessionTypePickerDelegate ?? {
|
|
2396
2685
|
getActiveSessionProvider: () => {
|
|
2397
|
-
return
|
|
2686
|
+
return this.getActiveSessionTypeForDelegation();
|
|
2398
2687
|
},
|
|
2399
2688
|
getPendingDelegationTarget: () => {
|
|
2400
2689
|
return this._pendingDelegationTarget;
|
|
2401
2690
|
},
|
|
2402
2691
|
setPendingDelegationTarget: provider => {
|
|
2403
|
-
|
|
2404
|
-
this._pendingDelegationTarget = isActive ? undefined : provider;
|
|
2405
|
-
this.updateWidgetLockStateFromSessionType(provider);
|
|
2406
|
-
this.updateAgentSessionTypeContextKey();
|
|
2407
|
-
this.refreshChatSessionPickers();
|
|
2692
|
+
this.setPendingDelegationTarget(provider);
|
|
2408
2693
|
},
|
|
2409
2694
|
hasGitRepository: () => this.hasWorkspaceScmRepository()
|
|
2410
2695
|
};
|
|
@@ -2460,7 +2745,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2460
2745
|
this.chatSessionsService.setSessionOption(sessionResource, groupId, item);
|
|
2461
2746
|
}
|
|
2462
2747
|
this.permissionWidget?.refresh();
|
|
2463
|
-
}
|
|
2748
|
+
},
|
|
2749
|
+
isSandboxToggleApplicable: () => this.getEffectiveSessionType(this.getCurrentSessionResource()) === SessionType.Local
|
|
2464
2750
|
};
|
|
2465
2751
|
const widget = this.instantiationService.createInstance(PermissionPickerActionItem, action, delegate, secondaryPickerOptions);
|
|
2466
2752
|
this.permissionWidget = widget;
|
|
@@ -2478,6 +2764,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2478
2764
|
const property = action.id === OpenAgentHostAutoApprovePickerAction.ID ? SessionConfigKey.AutoApprove : action.id === OpenAgentHostPermissionModePickerAction.ID ? ClaudeSessionConfigKey.PermissionMode : SessionConfigKey.Mode;
|
|
2479
2765
|
const picker = this.instantiationService.createInstance(AgentHostChatInputPicker, widget, property);
|
|
2480
2766
|
return ( new AgentHostChatInputPickerActionViewItem(action, picker));
|
|
2767
|
+
} else if (action.id === OpenAgentHostFolderPickerAction.ID && action instanceof MenuItemAction) {
|
|
2768
|
+
if (this.options.isSessionsWindow) {
|
|
2769
|
+
return ( new HiddenActionViewItem(action));
|
|
2770
|
+
}
|
|
2771
|
+
return this.instantiationService.createInstance(AgentHostFolderPickerActionItem, action, widget, secondaryPickerOptions);
|
|
2481
2772
|
} else if (action.id === ChatSessionPrimaryPickerAction.ID && action instanceof MenuItemAction) {
|
|
2482
2773
|
const widgets = this.createChatSessionPickerWidgets(action, secondaryPickerOptions);
|
|
2483
2774
|
if (widgets.length === 0) {
|
|
@@ -2511,13 +2802,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2511
2802
|
shouldForwardArgs: true
|
|
2512
2803
|
},
|
|
2513
2804
|
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
2514
|
-
hoverDelegate
|
|
2515
|
-
actionViewItemProvider: (action, _opts) => {
|
|
2516
|
-
if (action instanceof MenuItemAction) {
|
|
2517
|
-
return this.instantiationService.createInstance(ChatInputStatusActionViewItem, action);
|
|
2518
|
-
}
|
|
2519
|
-
return undefined;
|
|
2520
|
-
}
|
|
2805
|
+
hoverDelegate
|
|
2521
2806
|
}
|
|
2522
2807
|
));
|
|
2523
2808
|
this.statusToolbar.getElement().classList.add("chat-input-status-toolbar");
|
|
@@ -2688,7 +2973,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2688
2973
|
let attachmentWidget;
|
|
2689
2974
|
const options = {
|
|
2690
2975
|
shouldFocusClearButton,
|
|
2691
|
-
supportsDeletion: true
|
|
2976
|
+
supportsDeletion: true,
|
|
2977
|
+
isCurrentInput: true
|
|
2692
2978
|
};
|
|
2693
2979
|
const lm = this._currentLanguageModel.get();
|
|
2694
2980
|
if (attachment.kind === "tool" || attachment.kind === "toolset") {
|
|
@@ -3242,7 +3528,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3242
3528
|
const button = this._chatEditsActionsDisposables.add(( new ButtonWithIcon(overviewTitle, {
|
|
3243
3529
|
supportIcons: true,
|
|
3244
3530
|
secondary: true,
|
|
3245
|
-
ariaLabel: ( localize(
|
|
3531
|
+
ariaLabel: ( localize(8251, "Toggle changed files."))
|
|
3246
3532
|
})));
|
|
3247
3533
|
const topLevelStats = derived(reader => {
|
|
3248
3534
|
const entries = editSessionEntriesObs.read(reader);
|
|
@@ -3304,6 +3590,12 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3304
3590
|
isSecondary: true
|
|
3305
3591
|
};
|
|
3306
3592
|
}
|
|
3593
|
+
if (action.id === "github.copilot.chat.cloudSessions.openPullRequestForTask") {
|
|
3594
|
+
return {
|
|
3595
|
+
showIcon: true,
|
|
3596
|
+
showLabel: false
|
|
3597
|
+
};
|
|
3598
|
+
}
|
|
3307
3599
|
return undefined;
|
|
3308
3600
|
}
|
|
3309
3601
|
}
|
|
@@ -3316,10 +3608,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3316
3608
|
removed,
|
|
3317
3609
|
shouldShowEditingSession
|
|
3318
3610
|
} = topLevelStats.read(reader);
|
|
3319
|
-
const buttonLabel = files === 1 ? ( localize(
|
|
3611
|
+
const buttonLabel = files === 1 ? ( localize(8252, "1 file changed")) : ( localize(8253, "{0} files changed", files));
|
|
3320
3612
|
button.label = buttonLabel;
|
|
3321
3613
|
button.element.setAttribute("aria-label", ( localize(
|
|
3322
|
-
|
|
3614
|
+
8254,
|
|
3323
3615
|
"{0}, {1} lines added, {2} lines removed",
|
|
3324
3616
|
buttonLabel,
|
|
3325
3617
|
added,
|
|
@@ -3485,7 +3777,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3485
3777
|
const currentEditorHeight = this.previousInputEditorDimension?.height ?? 0;
|
|
3486
3778
|
const nonEditorHeight = Math.max(0, this.height.get() - currentEditorHeight);
|
|
3487
3779
|
const budgetForEditor = this._maxHeight - nonEditorHeight;
|
|
3488
|
-
|
|
3780
|
+
const minEditorHeight = this.inputEditorMinHeight ?? this.singleLineInputEditorHeight;
|
|
3781
|
+
return Math.max(
|
|
3782
|
+
minEditorHeight,
|
|
3783
|
+
Math.min(this.inputEditorMaxHeight, Math.max(0, budgetForEditor))
|
|
3784
|
+
);
|
|
3489
3785
|
}
|
|
3490
3786
|
_layout(width, allowRecurse = true) {
|
|
3491
3787
|
const data = this.getLayoutData();
|
|
@@ -3525,7 +3821,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3525
3821
|
};
|
|
3526
3822
|
return {
|
|
3527
3823
|
editorBorder: 2,
|
|
3528
|
-
inputPartHorizontalPadding: this.options.renderStyle === "compact" ? 16 : 24,
|
|
3824
|
+
inputPartHorizontalPadding: this.options.inputPartHorizontalPadding ?? (this.options.renderStyle === "compact" ? 16 : (this.options.isSessionsWindow ? 64 : 24)),
|
|
3529
3825
|
inputPartHorizontalPaddingInside: this.options.renderStyle === "compact" ? 12 : 10,
|
|
3530
3826
|
toolbarsWidth: this.options.renderStyle === "compact" ? getToolbarsWidthCompact() : 0,
|
|
3531
3827
|
sideToolbarWidth: inputSideToolbarWidth > 0 ? inputSideToolbarWidth + 4 : 0
|
|
@@ -3604,7 +3900,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
3604
3900
|
this.updateInputEditorScrollbarOptions();
|
|
3605
3901
|
}
|
|
3606
3902
|
};
|
|
3607
|
-
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));
|
|
3903
|
+
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)), ( __param(32, IProductService))], ChatInputPart));
|
|
3608
3904
|
function getLastPosition(model) {
|
|
3609
3905
|
return {
|
|
3610
3906
|
lineNumber: model.getLineCount(),
|