@codingame/monaco-vscode-katex-common 29.1.0 → 30.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +14 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +208 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +637 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionApprovalModel.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +202 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +17 -8
- 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 +53 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +296 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +59 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +55 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +110 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +384 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +220 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +1 -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 +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +40 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +97 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +5 -4
- 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.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +8 -7
- 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 +15 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +155 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +36 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +1 -1
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +33 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +4 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +37 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +66 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +103 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +35 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +44 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +60 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +5 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +6 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +39 -39
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +746 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +300 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1963 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +314 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +886 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +118 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +313 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +185 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +104 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +43 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +69 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +933 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +32 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +643 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +197 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
- package/vscode/src/vs/workbench/contrib/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/chatSessions/chatSessions.contribution.d.ts +0 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1317
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +0 -95
|
@@ -10,6 +10,7 @@ import { createInstantHoverDelegate } from '@codingame/monaco-vscode-api/vscode/
|
|
|
10
10
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
11
11
|
import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
12
12
|
import { RunOnceScheduler, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
13
|
+
import { isDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
13
14
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
14
15
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
15
16
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
@@ -75,13 +76,13 @@ import { AccessibilityCommandId } from '@codingame/monaco-vscode-api/vscode/vs/w
|
|
|
75
76
|
import { getSimpleEditorOptions, getSimpleCodeEditorWidgetOptions, setupSimpleEditorSelectionStyling } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
76
77
|
import { InlineChatConfigKeys } from '../../../../inlineChat/common/inlineChat.js';
|
|
77
78
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
78
|
-
import { ChatRequestVariableSet, isImageVariableEntry, isStringVariableEntry, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
79
|
+
import { ChatRequestVariableSet, isImageVariableEntry, isStringVariableEntry, MAX_IMAGES_PER_REQUEST, OmittedState, isNotebookOutputVariableEntry, isPromptFileVariableEntry, isPromptTextVariableEntry, isElementVariableEntry, isPasteVariableEntry, isSCMHistoryItemVariableEntry, isSCMHistoryItemChangeVariableEntry, isSCMHistoryItemChangeRangeVariableEntry } 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
82
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
82
83
|
import { agentOptionId, localChatSessionType, isIChatSessionFileChange2 } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
83
84
|
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
84
|
-
import { ChatAgentLocation, ChatModeKind, ChatPermissionLevel,
|
|
85
|
+
import { ChatAgentLocation, ChatModeKind, ChatPermissionLevel, validateChatMode, ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
85
86
|
import { ModifiedFileEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService';
|
|
86
87
|
import { ILanguageModelChatMetadata } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
87
88
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
@@ -91,7 +92,7 @@ import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
91
92
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
92
93
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
93
94
|
import { ChatHistoryNavigator } from '../../../common/widget/chatWidgetHistoryService.js';
|
|
94
|
-
import { ChatSubmitAction,
|
|
95
|
+
import { ChatSubmitAction, OpenModePickerAction, OpenModelPickerAction, OpenSessionTargetPickerAction, OpenDelegationPickerAction, OpenWorkspacePickerAction, ChatSessionPrimaryPickerAction, OpenPermissionPickerAction } from '../../actions/chatExecuteActions.js';
|
|
95
96
|
import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
96
97
|
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
97
98
|
import { ChatAttachmentModel } from '../../attachments/chatAttachmentModel.js';
|
|
@@ -121,6 +122,8 @@ import { WorkspacePickerActionItem } from './workspacePickerActionItem.js';
|
|
|
121
122
|
import { ChatContextUsageWidget } from '../../widgetHosts/viewPane/chatContextUsageWidget.js';
|
|
122
123
|
import { Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
123
124
|
import { EnhancedModelPickerActionItem } from './modelPickerActionItem2.js';
|
|
125
|
+
import { findLast } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arraysFind';
|
|
126
|
+
import { ConfigureToolsAction } from '../../actions/chatToolActions.js';
|
|
124
127
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
125
128
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
126
129
|
import { derived, derivedOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
@@ -364,9 +367,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
364
367
|
this._forceVisibleScrollbarUntilAccept = false;
|
|
365
368
|
this._modelSyncDisposables = this._register(( new DisposableStore()));
|
|
366
369
|
this._isSyncingToOrFromInputModel = false;
|
|
367
|
-
this.chatSessionPickerWidgets = ( new
|
|
370
|
+
this.chatSessionPickerWidgets = this._register(( new DisposableMap()));
|
|
368
371
|
this._waitForPersistedLanguageModel = this._register(( new MutableDisposable()));
|
|
369
|
-
this._chatSessionOptionEmitters = ( new
|
|
372
|
+
this._chatSessionOptionEmitters = this._register(( new DisposableMap()));
|
|
370
373
|
this._optionContextKeys = ( new Map());
|
|
371
374
|
this._currentLanguageModel = observableValue("_currentLanguageModel", undefined);
|
|
372
375
|
this._onDidChangeCurrentChatMode = this._register(( new Emitter()));
|
|
@@ -651,6 +654,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
651
654
|
this._currentPermissionLevel.set(level, undefined);
|
|
652
655
|
this.permissionLevelKey.set(level);
|
|
653
656
|
this.permissionWidget?.refresh();
|
|
657
|
+
this._syncInputStateToModel();
|
|
654
658
|
}
|
|
655
659
|
openSessionTargetPicker() {
|
|
656
660
|
this.sessionTargetWidget?.show();
|
|
@@ -674,7 +678,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
674
678
|
optionGroups,
|
|
675
679
|
effectiveSessionType
|
|
676
680
|
} = result;
|
|
677
|
-
this.
|
|
681
|
+
this.chatSessionPickerWidgets.clearAndDisposeAll();
|
|
678
682
|
const widgets = [];
|
|
679
683
|
for (const optionGroup of optionGroups) {
|
|
680
684
|
if (!( visibleGroupIds.has(optionGroup.id))) {
|
|
@@ -719,15 +723,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
719
723
|
return widgets;
|
|
720
724
|
}
|
|
721
725
|
setInputModel(model, chatSessionIsEmpty) {
|
|
726
|
+
if (this._inputModel) {
|
|
727
|
+
this._syncInputStateToModel();
|
|
728
|
+
}
|
|
722
729
|
this._inputModel = model;
|
|
723
730
|
this._modelSyncDisposables.clear();
|
|
724
731
|
this.selectedToolsModel.resetSessionEnablementState();
|
|
725
732
|
this._chatSessionIsEmpty = chatSessionIsEmpty;
|
|
726
|
-
if (chatSessionIsEmpty && !this.configurationService.getValue(ChatConfiguration.GlobalAutoApprove) && !isAutoApproveLevel(this._currentPermissionLevel.get())) {
|
|
727
|
-
this._currentPermissionLevel.set(ChatPermissionLevel.Default, undefined);
|
|
728
|
-
this.permissionLevelKey.set(ChatPermissionLevel.Default);
|
|
729
|
-
this.permissionWidget?.refresh();
|
|
730
|
-
}
|
|
731
733
|
if (chatSessionIsEmpty) {
|
|
732
734
|
this._setEmptyModelState();
|
|
733
735
|
}
|
|
@@ -805,6 +807,14 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
805
807
|
this._inputEditor.setSelections(state.selections);
|
|
806
808
|
}
|
|
807
809
|
}
|
|
810
|
+
if (!this.configurationService.getValue(ChatConfiguration.GlobalAutoApprove)) {
|
|
811
|
+
const targetLevel = state?.permissionLevel ?? ChatPermissionLevel.Default;
|
|
812
|
+
if (this._currentPermissionLevel.get() !== targetLevel) {
|
|
813
|
+
this._currentPermissionLevel.set(targetLevel, undefined);
|
|
814
|
+
this.permissionLevelKey.set(targetLevel);
|
|
815
|
+
this.permissionWidget?.refresh();
|
|
816
|
+
}
|
|
817
|
+
}
|
|
808
818
|
if (state) {
|
|
809
819
|
this._widget?.contribs.forEach(contrib => {
|
|
810
820
|
contrib.setInputState?.(state.contrib);
|
|
@@ -825,6 +835,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
825
835
|
}
|
|
826
836
|
this._inputModel?.setState(state);
|
|
827
837
|
this._isSyncingToOrFromInputModel = false;
|
|
838
|
+
queueMicrotask(() => this.inputActionsToolbar?.relayout());
|
|
828
839
|
}
|
|
829
840
|
setCurrentLanguageModel(model) {
|
|
830
841
|
this._currentLanguageModel.set(model, undefined);
|
|
@@ -923,23 +934,15 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
923
934
|
}
|
|
924
935
|
}
|
|
925
936
|
preselectModelFromSessionHistory() {
|
|
926
|
-
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
927
|
-
const ctx = sessionResource ? this.chatService.getChatSessionFromInternalUri(sessionResource) : undefined;
|
|
928
|
-
const requiresCustomModels = ctx && this.chatSessionsService.requiresCustomModelsForSessionType(getChatSessionType(ctx.chatSessionResource));
|
|
929
|
-
if (!requiresCustomModels) {
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
937
|
const requests = this._widget?.viewModel?.model.getRequests();
|
|
933
938
|
if (!requests || requests.length === 0) {
|
|
934
939
|
return;
|
|
935
940
|
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
lastModelId = requests[i].modelId;
|
|
940
|
-
break;
|
|
941
|
-
}
|
|
941
|
+
const modeInfo = findLast(requests, req => !!req.modeInfo)?.modeInfo;
|
|
942
|
+
if (modeInfo && modeInfo.modeInstructions?.uri) {
|
|
943
|
+
this.setChatMode(( modeInfo.modeInstructions.uri.toString()));
|
|
942
944
|
}
|
|
945
|
+
const lastModelId = findLast(requests, req => !!req.modelId)?.modelId;
|
|
943
946
|
if (!lastModelId) {
|
|
944
947
|
return;
|
|
945
948
|
}
|
|
@@ -982,6 +985,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
982
985
|
},
|
|
983
986
|
selectedModel: this._currentLanguageModel.get(),
|
|
984
987
|
selections: this._inputEditor?.getSelections() || [],
|
|
988
|
+
permissionLevel: this._currentPermissionLevel.get(),
|
|
985
989
|
contrib: {}
|
|
986
990
|
};
|
|
987
991
|
for (const contrib of this._widget?.contribs || Iterable.empty()) {
|
|
@@ -997,40 +1001,40 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
997
1001
|
}
|
|
998
1002
|
const mode = this._currentModeObservable.get();
|
|
999
1003
|
const modelName = this._currentLanguageModel.get()?.metadata.name;
|
|
1000
|
-
const modelInfo = modelName ? ( localize(
|
|
1004
|
+
const modelInfo = modelName ? ( localize(7032, ", {0}. ", modelName)) : "";
|
|
1001
1005
|
let modeLabel = "";
|
|
1002
1006
|
if (!mode.isBuiltin) {
|
|
1003
1007
|
const mode = this.currentModeObs.get();
|
|
1004
|
-
modeLabel = ( localize(
|
|
1008
|
+
modeLabel = ( localize(7033, "({0}), {1}", mode.label.get(), mode.description.get()));
|
|
1005
1009
|
} else {
|
|
1006
1010
|
switch (this.currentModeKind) {
|
|
1007
1011
|
case ChatModeKind.Agent:
|
|
1008
|
-
modeLabel = ( localize(
|
|
1012
|
+
modeLabel = ( localize(7034, "(Agent), edit files in your workspace."));
|
|
1009
1013
|
break;
|
|
1010
1014
|
case ChatModeKind.Edit:
|
|
1011
|
-
modeLabel = ( localize(
|
|
1015
|
+
modeLabel = ( localize(7035, "(Edit), edit files in your workspace."));
|
|
1012
1016
|
break;
|
|
1013
1017
|
case ChatModeKind.Ask:
|
|
1014
1018
|
default:
|
|
1015
|
-
modeLabel = ( localize(
|
|
1019
|
+
modeLabel = ( localize(7036, "(Ask), ask questions or type / for topics."));
|
|
1016
1020
|
break;
|
|
1017
1021
|
}
|
|
1018
1022
|
}
|
|
1019
1023
|
if (verbose) {
|
|
1020
1024
|
return kbLabel ? ( localize(
|
|
1021
|
-
|
|
1025
|
+
7037,
|
|
1022
1026
|
"Chat Input {0}{1} Press Enter to send out the request. Use {2} for Chat Accessibility Help.",
|
|
1023
1027
|
modeLabel,
|
|
1024
1028
|
modelInfo,
|
|
1025
1029
|
kbLabel
|
|
1026
1030
|
)) : ( localize(
|
|
1027
|
-
|
|
1031
|
+
7038,
|
|
1028
1032
|
"Chat Input {0}{1} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.",
|
|
1029
1033
|
modeLabel,
|
|
1030
1034
|
modelInfo
|
|
1031
1035
|
));
|
|
1032
1036
|
} else {
|
|
1033
|
-
return localize(
|
|
1037
|
+
return localize(7039, "Chat Input {0}{1}.", modeLabel, modelInfo);
|
|
1034
1038
|
}
|
|
1035
1039
|
}
|
|
1036
1040
|
validateCurrentChatMode() {
|
|
@@ -1101,12 +1105,11 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1101
1105
|
}
|
|
1102
1106
|
this.navigateHistory(false);
|
|
1103
1107
|
}
|
|
1104
|
-
async
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
if (isImageVariableEntry(attachment) && attachment.references?.length && URI.isUri(attachment.references[0].reference)) {
|
|
1108
|
+
async restoreAttachments(attachments) {
|
|
1109
|
+
let restored = [...attachments];
|
|
1110
|
+
if (restored.length > 0) {
|
|
1111
|
+
restored = (await Promise.all(( restored.map(async attachment => {
|
|
1112
|
+
if (isImageVariableEntry(attachment) && !attachment.value && attachment.references?.length && URI.isUri(attachment.references[0].reference)) {
|
|
1110
1113
|
const currReference = attachment.references[0].reference;
|
|
1111
1114
|
try {
|
|
1112
1115
|
const imageBinary = ( currReference.toString(true)).startsWith("http") ? await this.sharedWebExtracterService.readImage(currReference, CancellationToken.None) : (await this.fileService.readFile(currReference)).value;
|
|
@@ -1124,9 +1127,13 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1124
1127
|
}
|
|
1125
1128
|
}
|
|
1126
1129
|
return attachment;
|
|
1127
|
-
})))).filter(
|
|
1130
|
+
})))).filter(isDefined);
|
|
1128
1131
|
}
|
|
1129
|
-
this._attachmentModel.clearAndSetContext(...
|
|
1132
|
+
this._attachmentModel.clearAndSetContext(...restored);
|
|
1133
|
+
}
|
|
1134
|
+
async navigateHistory(previous) {
|
|
1135
|
+
const historyEntry = previous ? this.history.previous() : this.history.next();
|
|
1136
|
+
await this.restoreAttachments(historyEntry?.attachments ?? []);
|
|
1130
1137
|
const inputText = historyEntry?.inputText ?? "";
|
|
1131
1138
|
const contribData = historyEntry?.contrib ?? {};
|
|
1132
1139
|
status(inputText);
|
|
@@ -1227,7 +1234,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1227
1234
|
getOrCreateOptionEmitter(optionGroupId) {
|
|
1228
1235
|
let emitter = this._chatSessionOptionEmitters.get(optionGroupId);
|
|
1229
1236
|
if (!emitter) {
|
|
1230
|
-
emitter =
|
|
1237
|
+
emitter = ( new Emitter());
|
|
1231
1238
|
this._chatSessionOptionEmitters.set(optionGroupId, emitter);
|
|
1232
1239
|
}
|
|
1233
1240
|
return emitter;
|
|
@@ -1276,8 +1283,9 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1276
1283
|
const requiresCustomModels = ctx && this.chatSessionsService.requiresCustomModelsForSessionType(getChatSessionType(ctx.chatSessionResource));
|
|
1277
1284
|
this.chatSessionHasTargetedModels.set(!!requiresCustomModels);
|
|
1278
1285
|
if (customAgentTarget) {
|
|
1286
|
+
const contribution = ctx && this.chatSessionsService.getChatSessionContribution(getChatSessionType(ctx.chatSessionResource));
|
|
1279
1287
|
const agentOption = this.chatSessionsService.getSessionOption(ctx.chatSessionResource, agentOptionId);
|
|
1280
|
-
if (typeof agentOption !== "undefined") {
|
|
1288
|
+
if (typeof agentOption !== "undefined" && !contribution?.useRequestToPopulateBuiltInPickers) {
|
|
1281
1289
|
const agentId = (typeof agentOption === "string" ? agentOption : agentOption.id) || ChatMode.Agent.id;
|
|
1282
1290
|
const currentMode = this._currentModeObservable.get();
|
|
1283
1291
|
const isDefaultAgent = agentId === ChatMode.Agent.id;
|
|
@@ -1369,7 +1377,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1369
1377
|
this.chatSessionPickerContainer.style.display = "";
|
|
1370
1378
|
}
|
|
1371
1379
|
if (ctx) {
|
|
1372
|
-
for (const [optionGroupId] of this.chatSessionPickerWidgets
|
|
1380
|
+
for (const [optionGroupId] of this.chatSessionPickerWidgets) {
|
|
1373
1381
|
const currentOption = this.chatSessionsService.getSessionOption(ctx.chatSessionResource, optionGroupId);
|
|
1374
1382
|
if (currentOption) {
|
|
1375
1383
|
const optionGroup = optionGroups.find(g => g.id === optionGroupId);
|
|
@@ -1391,12 +1399,6 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1391
1399
|
this.chatSessionPickerContainer.style.display = "none";
|
|
1392
1400
|
}
|
|
1393
1401
|
}
|
|
1394
|
-
disposeSessionPickerWidgets() {
|
|
1395
|
-
for (const widget of ( this.chatSessionPickerWidgets.values())) {
|
|
1396
|
-
widget.dispose();
|
|
1397
|
-
}
|
|
1398
|
-
this.chatSessionPickerWidgets.clear();
|
|
1399
|
-
}
|
|
1400
1402
|
getCurrentOptionForGroup(optionGroupId) {
|
|
1401
1403
|
const sessionResource = this._widget?.viewModel?.model.sessionResource;
|
|
1402
1404
|
if (!sessionResource) {
|
|
@@ -1699,7 +1701,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1699
1701
|
}
|
|
1700
1702
|
}));
|
|
1701
1703
|
this._register(this._inputEditor.onDidChangeModelContent(() => {
|
|
1702
|
-
const currentHeight = Math.min(this._inputEditor.getContentHeight(), this.
|
|
1704
|
+
const currentHeight = Math.min(this._inputEditor.getContentHeight(), this._effectiveInputEditorMaxHeight);
|
|
1703
1705
|
if (currentHeight !== this.inputEditorHeight) {
|
|
1704
1706
|
this.inputEditorHeight = currentHeight;
|
|
1705
1707
|
if (this.cachedWidth) {
|
|
@@ -1759,6 +1761,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1759
1761
|
EventType.CLICK,
|
|
1760
1762
|
e => this.inputEditor.focus()
|
|
1761
1763
|
));
|
|
1764
|
+
const shorterChatInputActionIds = ( new Set([OpenModePickerAction.ID, ConfigureToolsAction.ID]));
|
|
1762
1765
|
this.inputActionsToolbar = this._register(this.instantiationService.createInstance(
|
|
1763
1766
|
MenuWorkbenchToolBar,
|
|
1764
1767
|
this.options.renderInputToolbarBelowInput ? this.attachmentsContainer : toolbarsContainer,
|
|
@@ -1774,7 +1777,8 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1774
1777
|
enabled: true,
|
|
1775
1778
|
kind: "last",
|
|
1776
1779
|
minItems: 1,
|
|
1777
|
-
actionMinWidth:
|
|
1780
|
+
actionMinWidth: 48,
|
|
1781
|
+
getActionMinWidth: action => ( shorterChatInputActionIds.has(action.id)) ? 22 : undefined
|
|
1778
1782
|
},
|
|
1779
1783
|
actionViewItemProvider: (action, options) => {
|
|
1780
1784
|
if (action.id === OpenModelPickerAction.ID && action instanceof MenuItemAction) {
|
|
@@ -1821,7 +1825,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1821
1825
|
} else if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
1822
1826
|
const getActiveSessionType = () => {
|
|
1823
1827
|
const sessionResource = this._widget?.viewModel?.sessionResource;
|
|
1824
|
-
return sessionResource ? getAgentSessionProvider(sessionResource) : undefined;
|
|
1828
|
+
return sessionResource ? (getAgentSessionProvider(sessionResource) ?? getChatSessionType(sessionResource)) : undefined;
|
|
1825
1829
|
};
|
|
1826
1830
|
const delegate = this.options.sessionTypePickerDelegate ?? {
|
|
1827
1831
|
getActiveSessionProvider: () => {
|
|
@@ -1881,6 +1885,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1881
1885
|
this._toolbarRelayoutScheduler.schedule();
|
|
1882
1886
|
}
|
|
1883
1887
|
}));
|
|
1888
|
+
this._register(autorun(reader => {
|
|
1889
|
+
pickerOptions.hideChevrons.read(reader);
|
|
1890
|
+
queueMicrotask(() => this.inputActionsToolbar.relayout());
|
|
1891
|
+
}));
|
|
1884
1892
|
this.executeToolbar = this._register(this.instantiationService.createInstance(
|
|
1885
1893
|
MenuWorkbenchToolBar,
|
|
1886
1894
|
toolbarsContainer,
|
|
@@ -1937,7 +1945,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1937
1945
|
if ((action.id === OpenSessionTargetPickerAction.ID || action.id === OpenDelegationPickerAction.ID) && action instanceof MenuItemAction) {
|
|
1938
1946
|
const getActiveSessionType = () => {
|
|
1939
1947
|
const sessionResource = this._widget?.viewModel?.sessionResource;
|
|
1940
|
-
return sessionResource ? getAgentSessionProvider(sessionResource) : undefined;
|
|
1948
|
+
return sessionResource ? (getAgentSessionProvider(sessionResource) ?? getChatSessionType(sessionResource)) : undefined;
|
|
1941
1949
|
};
|
|
1942
1950
|
const delegate = this.options.sessionTypePickerDelegate ?? {
|
|
1943
1951
|
getActiveSessionProvider: () => {
|
|
@@ -1982,8 +1990,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
1982
1990
|
const delegate = {
|
|
1983
1991
|
currentPermissionLevel: this._currentPermissionLevel,
|
|
1984
1992
|
setPermissionLevel: level => {
|
|
1985
|
-
this.
|
|
1986
|
-
this.permissionLevelKey.set(level);
|
|
1993
|
+
this.setPermissionLevel(level);
|
|
1987
1994
|
}
|
|
1988
1995
|
};
|
|
1989
1996
|
return this.permissionWidget = this.instantiationService.createInstance(PermissionPickerActionItem, action, delegate, pickerOptions);
|
|
@@ -2124,6 +2131,27 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2124
2131
|
this._indexOfLastAttachedContextDeletedWithKeyboard = -1;
|
|
2125
2132
|
this._indexOfLastOpenedContext = -1;
|
|
2126
2133
|
}
|
|
2134
|
+
const imageAttachments = attachments.filter(([, a]) => isImageVariableEntry(a));
|
|
2135
|
+
if (imageAttachments.length > MAX_IMAGES_PER_REQUEST) {
|
|
2136
|
+
const excessCount = imageAttachments.length - MAX_IMAGES_PER_REQUEST;
|
|
2137
|
+
for (let i = 0; i < excessCount; i++) {
|
|
2138
|
+
const attachment = imageAttachments[i][1];
|
|
2139
|
+
if (attachment.omittedState === OmittedState.NotOmitted || attachment.omittedState === OmittedState.ImageLimitExceeded) {
|
|
2140
|
+
attachment.omittedState = OmittedState.ImageLimitExceeded;
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
for (let i = excessCount; i < imageAttachments.length; i++) {
|
|
2144
|
+
if (imageAttachments[i][1].omittedState === OmittedState.ImageLimitExceeded) {
|
|
2145
|
+
imageAttachments[i][1].omittedState = OmittedState.NotOmitted;
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
} else {
|
|
2149
|
+
for (const [, a] of imageAttachments) {
|
|
2150
|
+
if (a.omittedState === OmittedState.ImageLimitExceeded) {
|
|
2151
|
+
a.omittedState = OmittedState.NotOmitted;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2127
2155
|
for (const [index, attachment] of attachments) {
|
|
2128
2156
|
const resource = URI.isUri(attachment.value) ? attachment.value : isLocation(attachment.value) ? attachment.value.uri : undefined;
|
|
2129
2157
|
const range = isLocation(attachment.value) ? attachment.value.range : undefined;
|
|
@@ -2557,7 +2585,7 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2557
2585
|
const button = this._chatEditsActionsDisposables.add(( new ButtonWithIcon(overviewTitle, {
|
|
2558
2586
|
supportIcons: true,
|
|
2559
2587
|
secondary: true,
|
|
2560
|
-
ariaLabel: ( localize(
|
|
2588
|
+
ariaLabel: ( localize(7040, "Toggle changed files."))
|
|
2561
2589
|
})));
|
|
2562
2590
|
const topLevelStats = derived(reader => {
|
|
2563
2591
|
const entries = editSessionEntriesObs.read(reader);
|
|
@@ -2631,10 +2659,10 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2631
2659
|
removed,
|
|
2632
2660
|
shouldShowEditingSession
|
|
2633
2661
|
} = topLevelStats.read(reader);
|
|
2634
|
-
const buttonLabel = files === 1 ? ( localize(
|
|
2662
|
+
const buttonLabel = files === 1 ? ( localize(7041, "1 file changed")) : ( localize(7042, "{0} files changed", files));
|
|
2635
2663
|
button.label = buttonLabel;
|
|
2636
2664
|
button.element.setAttribute("aria-label", ( localize(
|
|
2637
|
-
|
|
2665
|
+
7043,
|
|
2638
2666
|
"{0}, {1} lines added, {2} lines removed",
|
|
2639
2667
|
buttonLabel,
|
|
2640
2668
|
added,
|
|
@@ -2748,21 +2776,35 @@ let ChatInputPart = class ChatInputPart extends Disposable {
|
|
|
2748
2776
|
));
|
|
2749
2777
|
}
|
|
2750
2778
|
}
|
|
2779
|
+
setMaxHeight(maxHeight) {
|
|
2780
|
+
this._maxHeight = maxHeight;
|
|
2781
|
+
}
|
|
2751
2782
|
layout(width) {
|
|
2752
2783
|
this.cachedWidth = width;
|
|
2753
2784
|
this._stableInputPartWidth.set(width, undefined);
|
|
2754
2785
|
return this._layout(width);
|
|
2755
2786
|
}
|
|
2787
|
+
get _effectiveInputEditorMaxHeight() {
|
|
2788
|
+
if (this._maxHeight === undefined) {
|
|
2789
|
+
return this.inputEditorMaxHeight;
|
|
2790
|
+
}
|
|
2791
|
+
const currentEditorHeight = this.previousInputEditorDimension?.height ?? 0;
|
|
2792
|
+
const nonEditorHeight = Math.max(0, this.height.get() - currentEditorHeight);
|
|
2793
|
+
const budgetForEditor = this._maxHeight - nonEditorHeight;
|
|
2794
|
+
return Math.min(this.inputEditorMaxHeight, Math.max(0, budgetForEditor));
|
|
2795
|
+
}
|
|
2756
2796
|
_layout(width, allowRecurse = true) {
|
|
2757
2797
|
const data = this.getLayoutData();
|
|
2758
2798
|
const followupsWidth = width - data.inputPartHorizontalPadding;
|
|
2759
2799
|
this.followupsContainer.style.width = `${followupsWidth}px`;
|
|
2760
2800
|
const initialEditorScrollWidth = this._inputEditor.getScrollWidth();
|
|
2761
2801
|
const newEditorWidth = width - data.inputPartHorizontalPadding - data.editorBorder - data.inputPartHorizontalPaddingInside - data.toolbarsWidth - data.sideToolbarWidth;
|
|
2762
|
-
const
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2802
|
+
const effectiveMaxHeight = this._effectiveInputEditorMaxHeight;
|
|
2803
|
+
const clampedContentHeight = Math.min(this._inputEditor.getContentHeight(), effectiveMaxHeight);
|
|
2804
|
+
const inputEditorHeight = this.inputEditorMinHeight ? Math.min(
|
|
2805
|
+
Math.max(this.inputEditorMinHeight, clampedContentHeight),
|
|
2806
|
+
effectiveMaxHeight
|
|
2807
|
+
) : clampedContentHeight;
|
|
2766
2808
|
const newDimension = {
|
|
2767
2809
|
width: newEditorWidth,
|
|
2768
2810
|
height: inputEditorHeight
|
|
@@ -31,7 +31,7 @@ import { IUpdateService } from "@codingame/monaco-vscode-api/vscode/vs/platform/
|
|
|
31
31
|
export declare function buildModelPickerItems(models: ILanguageModelChatMetadataAndIdentifier[], selectedModelId: string | undefined, recentModelIds: string[], controlModels: IStringDictionary<IModelControlEntry>, currentVSCodeVersion: string, updateStateType: StateType, onSelect: (model: ILanguageModelChatMetadataAndIdentifier) => void, manageSettingsUrl: string | undefined, useGroupedModelPicker: boolean, manageModelsAction: IActionWidgetDropdownAction | undefined, chatEntitlementService: IChatEntitlementService, showUnavailableFeatured: boolean, showFeatured: boolean, hoverPosition?: IHoverPositionOptions, languageModelsService?: ILanguageModelsService): IActionListItem<IActionWidgetDropdownAction>[];
|
|
32
32
|
export declare function getModelPickerAccessibilityProvider(): {
|
|
33
33
|
readonly isChecked: (element: IActionListItem<IActionWidgetDropdownAction>) => boolean | undefined;
|
|
34
|
-
readonly getRole: (element: IActionListItem<IActionWidgetDropdownAction>) => "separator" | "menuitemradio";
|
|
34
|
+
readonly getRole: (element: IActionListItem<IActionWidgetDropdownAction>) => "separator" | "menuitem" | "menuitemradio";
|
|
35
35
|
readonly getWidgetRole: () => string;
|
|
36
36
|
};
|
|
37
37
|
export type ModelPickerBadge = "info" | "warning";
|
|
@@ -69,6 +69,7 @@ export declare class ModelPickerWidget extends Disposable {
|
|
|
69
69
|
constructor(_delegate: IModelPickerDelegate, _hoverPosition: IHoverPositionOptions | undefined, _actionWidgetService: IActionWidgetService, _commandService: ICommandService, _openerService: IOpenerService, _telemetryService: ITelemetryService, _languageModelsService: ILanguageModelsService, _productService: IProductService, _entitlementService: IChatEntitlementService, _updateService: IUpdateService, _uriIdentityService: IUriIdentityService);
|
|
70
70
|
setHideChevrons(hideChevrons: IObservable<boolean>): void;
|
|
71
71
|
setSelectedModel(model: ILanguageModelChatMetadataAndIdentifier | undefined): void;
|
|
72
|
+
setEnabled(enabled: boolean): void;
|
|
72
73
|
setBadge(badge: ModelPickerBadge | undefined): void;
|
|
73
74
|
render(container: HTMLElement): void;
|
|
74
75
|
show(anchor?: HTMLElement): void;
|
|
@@ -44,20 +44,20 @@ function getUpdateHoverContent(updateState) {
|
|
|
44
44
|
switch (updateState) {
|
|
45
45
|
case StateType.AvailableForDownload:
|
|
46
46
|
hoverContent.appendMarkdown(( localize(
|
|
47
|
-
|
|
47
|
+
7044,
|
|
48
48
|
"This model requires a newer version of VS Code. [Download Update](command:update.downloadUpdate) to access it."
|
|
49
49
|
)));
|
|
50
50
|
break;
|
|
51
51
|
case StateType.Downloaded:
|
|
52
52
|
case StateType.Ready:
|
|
53
53
|
hoverContent.appendMarkdown(( localize(
|
|
54
|
-
|
|
54
|
+
7045,
|
|
55
55
|
"This model requires a newer version of VS Code. [Restart to Update](command:update.restartToUpdate) to access it."
|
|
56
56
|
)));
|
|
57
57
|
break;
|
|
58
58
|
default:
|
|
59
59
|
hoverContent.appendMarkdown(( localize(
|
|
60
|
-
|
|
60
|
+
7046,
|
|
61
61
|
"This model requires a newer version of VS Code. [Update VS Code](command:update.checkForUpdate) to access it."
|
|
62
62
|
)));
|
|
63
63
|
break;
|
|
@@ -128,7 +128,7 @@ function createModelAction(model, selectedModelId, onSelect, languageModelsServi
|
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
function shouldShowManageModelsAction(chatEntitlementService) {
|
|
131
|
-
return chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal;
|
|
131
|
+
return chatEntitlementService.entitlement === ChatEntitlement.Free || chatEntitlementService.entitlement === ChatEntitlement.EDU || chatEntitlementService.entitlement === ChatEntitlement.Pro || chatEntitlementService.entitlement === ChatEntitlement.ProPlus || chatEntitlementService.entitlement === ChatEntitlement.Business || chatEntitlementService.entitlement === ChatEntitlement.Enterprise || chatEntitlementService.isInternal;
|
|
132
132
|
}
|
|
133
133
|
function createManageModelsAction(commandService) {
|
|
134
134
|
return {
|
|
@@ -136,8 +136,8 @@ function createManageModelsAction(commandService) {
|
|
|
136
136
|
enabled: true,
|
|
137
137
|
checked: false,
|
|
138
138
|
class: ThemeIcon.asClassName(Codicon.gear),
|
|
139
|
-
tooltip: ( localize(
|
|
140
|
-
label: ( localize(
|
|
139
|
+
tooltip: ( localize(7047, "Manage Language Models")),
|
|
140
|
+
label: ( localize(7048, "Manage Models...")),
|
|
141
141
|
run: () => {
|
|
142
142
|
commandService.executeCommand(MANAGE_CHAT_COMMAND_ID);
|
|
143
143
|
}
|
|
@@ -167,8 +167,8 @@ function buildModelPickerItems(
|
|
|
167
167
|
enabled: true,
|
|
168
168
|
checked: true,
|
|
169
169
|
class: undefined,
|
|
170
|
-
tooltip: ( localize(
|
|
171
|
-
label: ( localize(
|
|
170
|
+
tooltip: ( localize(7049, "Auto")),
|
|
171
|
+
label: ( localize(7049, "Auto")),
|
|
172
172
|
run: () => {}
|
|
173
173
|
}));
|
|
174
174
|
}
|
|
@@ -351,12 +351,12 @@ function buildModelPickerItems(
|
|
|
351
351
|
enabled: true,
|
|
352
352
|
checked: false,
|
|
353
353
|
class: undefined,
|
|
354
|
-
tooltip: ( localize(
|
|
355
|
-
label: ( localize(
|
|
354
|
+
tooltip: ( localize(7050, "Other Models")),
|
|
355
|
+
label: ( localize(7050, "Other Models")),
|
|
356
356
|
run: () => {}
|
|
357
357
|
},
|
|
358
358
|
kind: ActionListItemKind.Action,
|
|
359
|
-
label: ( localize(
|
|
359
|
+
label: ( localize(7050, "Other Models")),
|
|
360
360
|
group: {
|
|
361
361
|
title: "",
|
|
362
362
|
icon: Codicon.chevronDown
|
|
@@ -435,9 +435,15 @@ function buildModelPickerItems(
|
|
|
435
435
|
function getModelPickerAccessibilityProvider() {
|
|
436
436
|
return {
|
|
437
437
|
isChecked(element) {
|
|
438
|
+
if (element.isSectionToggle) {
|
|
439
|
+
return undefined;
|
|
440
|
+
}
|
|
438
441
|
return element.kind === ActionListItemKind.Action ? !!element?.item?.checked : undefined;
|
|
439
442
|
},
|
|
440
443
|
getRole: element => {
|
|
444
|
+
if (element.isSectionToggle) {
|
|
445
|
+
return "menuitem";
|
|
446
|
+
}
|
|
441
447
|
switch (element.kind) {
|
|
442
448
|
case ActionListItemKind.Action:
|
|
443
449
|
return "menuitemradio";
|
|
@@ -461,15 +467,15 @@ function createUnavailableModelItem(
|
|
|
461
467
|
) {
|
|
462
468
|
let description;
|
|
463
469
|
if (reason === "upgrade") {
|
|
464
|
-
description = ( new MarkdownString(( localize(
|
|
470
|
+
description = ( new MarkdownString(( localize(7051, "[Upgrade](command:workbench.action.chat.upgradePlan \" \")")), {
|
|
465
471
|
isTrusted: true
|
|
466
472
|
}));
|
|
467
473
|
} else if (reason === "update") {
|
|
468
|
-
description = ( localize(
|
|
474
|
+
description = ( localize(7052, "Update VS Code"));
|
|
469
475
|
} else {
|
|
470
|
-
description = manageSettingsUrl ? ( new MarkdownString(( localize(
|
|
476
|
+
description = manageSettingsUrl ? ( new MarkdownString(( localize(7053, "[Contact your admin]({0})", manageSettingsUrl)), {
|
|
471
477
|
isTrusted: true
|
|
472
|
-
})) : ( localize(
|
|
478
|
+
})) : ( localize(7054, "Contact your admin"));
|
|
473
479
|
}
|
|
474
480
|
let hoverContent;
|
|
475
481
|
if (reason === "upgrade") {
|
|
@@ -478,7 +484,7 @@ function createUnavailableModelItem(
|
|
|
478
484
|
supportThemeIcons: true
|
|
479
485
|
}));
|
|
480
486
|
hoverContent.appendMarkdown(( localize(
|
|
481
|
-
|
|
487
|
+
7055,
|
|
482
488
|
"[Upgrade to GitHub Copilot Pro](command:workbench.action.chat.upgradePlan \" \") with a free 30-day trial to use the best models."
|
|
483
489
|
)));
|
|
484
490
|
} else if (reason === "update") {
|
|
@@ -489,7 +495,7 @@ function createUnavailableModelItem(
|
|
|
489
495
|
supportThemeIcons: true
|
|
490
496
|
}));
|
|
491
497
|
hoverContent.appendMarkdown(( localize(
|
|
492
|
-
|
|
498
|
+
7056,
|
|
493
499
|
"This model is not available. Contact your administrator to enable it."
|
|
494
500
|
)));
|
|
495
501
|
}
|
|
@@ -573,6 +579,12 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
573
579
|
this._selectedModel = model;
|
|
574
580
|
this._renderLabel();
|
|
575
581
|
}
|
|
582
|
+
setEnabled(enabled) {
|
|
583
|
+
if (this._domNode) {
|
|
584
|
+
this._domNode.classList.toggle("disabled", !enabled);
|
|
585
|
+
this._domNode.setAttribute("aria-disabled", String(!enabled));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
576
588
|
setBadge(badge) {
|
|
577
589
|
this._badge = badge;
|
|
578
590
|
this._updateBadge();
|
|
@@ -606,7 +618,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
606
618
|
}
|
|
607
619
|
show(anchor) {
|
|
608
620
|
const anchorElement = anchor ?? this._domNode;
|
|
609
|
-
if (!anchorElement) {
|
|
621
|
+
if (!anchorElement || this._domNode?.classList.contains("disabled")) {
|
|
610
622
|
return;
|
|
611
623
|
}
|
|
612
624
|
const previousModel = this._selectedModel;
|
|
@@ -651,7 +663,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
651
663
|
);
|
|
652
664
|
const listOptions = {
|
|
653
665
|
showFilter,
|
|
654
|
-
filterPlaceholder: ( localize(
|
|
666
|
+
filterPlaceholder: ( localize(7057, "Search models")),
|
|
655
667
|
filterActions: showFilter && manageModelsAction ? [manageModelsAction] : undefined,
|
|
656
668
|
focusFilterOnOpen: true,
|
|
657
669
|
collapsedByDefault: ( new Set([ModelPickerSection.Other])),
|
|
@@ -728,7 +740,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
728
740
|
const iconElement = renderIcon(statusIcon);
|
|
729
741
|
domChildren.push(iconElement);
|
|
730
742
|
}
|
|
731
|
-
const modelLabel = name ?? ( localize(
|
|
743
|
+
const modelLabel = name ?? ( localize(7049, "Auto"));
|
|
732
744
|
const configDescription = this._selectedModel ? getModelConfigurationDescription(this._selectedModel, this._languageModelsService) : undefined;
|
|
733
745
|
const fullLabel = configDescription ? `${modelLabel} · ${configDescription}` : modelLabel;
|
|
734
746
|
domChildren.push($("span.chat-input-picker-label", undefined, fullLabel));
|
|
@@ -737,7 +749,7 @@ let ModelPickerWidget = class ModelPickerWidget extends Disposable {
|
|
|
737
749
|
}
|
|
738
750
|
domChildren.push(...renderLabelWithIcons(`$(chevron-down)`));
|
|
739
751
|
reset(this._domNode, ...domChildren);
|
|
740
|
-
this._domNode.ariaLabel = ( localize(
|
|
752
|
+
this._domNode.ariaLabel = ( localize(7058, "Pick Model, {0}", fullLabel));
|
|
741
753
|
}
|
|
742
754
|
};
|
|
743
755
|
ModelPickerWidget = ( __decorate([( __param(2, IActionWidgetService)), ( __param(3, ICommandService)), ( __param(4, IOpenerService)), ( __param(5, ITelemetryService)), ( __param(6, ILanguageModelsService)), ( __param(7, IProductService)), ( __param(8, IChatEntitlementService)), ( __param(9, IUpdateService)), ( __param(10, IUriIdentityService))], ModelPickerWidget));
|
|
@@ -758,7 +770,7 @@ function getModelHoverContent(model, languageModelsService) {
|
|
|
758
770
|
}
|
|
759
771
|
if (model.metadata.multiplier) {
|
|
760
772
|
markdown.appendMarkdown(`${( localize(
|
|
761
|
-
|
|
773
|
+
7059,
|
|
762
774
|
"Each chat message counts {0} toward your premium request quota",
|
|
763
775
|
model.metadata.multiplier
|
|
764
776
|
))}`);
|
|
@@ -766,7 +778,7 @@ function getModelHoverContent(model, languageModelsService) {
|
|
|
766
778
|
}
|
|
767
779
|
if (!isAuto && (model.metadata.maxInputTokens || model.metadata.maxOutputTokens)) {
|
|
768
780
|
const totalTokens = (model.metadata.maxInputTokens ?? 0) + (model.metadata.maxOutputTokens ?? 0);
|
|
769
|
-
markdown.appendMarkdown(`${( localize(
|
|
781
|
+
markdown.appendMarkdown(`${( localize(7060, "Context Size"))}: `);
|
|
770
782
|
markdown.appendMarkdown(`${formatTokenCount(totalTokens)}`);
|
|
771
783
|
markdown.appendText(`\n`);
|
|
772
784
|
}
|