@codingame/monaco-vscode-katex-common 28.4.1 → 29.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +2 -2
- 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.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +158 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +22 -17
- 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 +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +121 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +15 -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 +29 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +349 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +104 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +21 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +29 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +261 -282
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +7 -5
- 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 +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +184 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +4 -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/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/chatDisabledClaudeHooksContentPart.js +4 -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 +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +42 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +14 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +11 -9
- 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 +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +25 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +332 -114
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +10 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +11 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +66 -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 +28 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +272 -107
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingExternalResourcesWidget.js +70 -0
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +6 -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/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/chatConfirmationWidget.css +151 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +96 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +86 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +5 -2
- 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/chatInputOutputMarkdownProgressPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +273 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +28 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +81 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +20 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +21 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +2 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +112 -163
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +137 -52
- 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 +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +108 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +385 -247
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +23 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +124 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +84 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalPromptFileSystem.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +4 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +38 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +31 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +12 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +130 -23
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +41 -0
- 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/browser/media/inlineChatOverlayWidget.css +55 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +50 -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/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/chatQuestionCarouselAutoReply.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +0 -440
|
@@ -20,7 +20,7 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
20
20
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
21
21
|
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
22
22
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
23
|
-
import { DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
23
|
+
import { MutableDisposable, DisposableMap, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
24
24
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
25
25
|
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
26
26
|
import { IChatMarkdownAnchorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service';
|
|
@@ -28,15 +28,32 @@ import { ChatMessageRole } from '@codingame/monaco-vscode-api/vscode/vs/workbenc
|
|
|
28
28
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
29
29
|
import * as chatThinkingContent from './media/chatThinkingContent.css';
|
|
30
30
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
31
|
+
import { extractImagesFromToolInvocationOutputDetails } from '../../../common/chatImageExtraction.js';
|
|
32
|
+
import { ChatThinkingExternalResourceWidget } from './chatThinkingExternalResourcesWidget.js';
|
|
31
33
|
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
32
34
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
33
35
|
|
|
36
|
+
var ChatThinkingContentPart_1;
|
|
34
37
|
registerCss(chatThinkingContent);
|
|
35
38
|
function extractTextFromPart(content) {
|
|
36
39
|
const raw = Array.isArray(content.value) ? content.value.join("") : (content.value || "");
|
|
37
40
|
return raw.trim();
|
|
38
41
|
}
|
|
39
|
-
function
|
|
42
|
+
function isEditToolId(toolId) {
|
|
43
|
+
const lowerToolId = toolId.toLowerCase();
|
|
44
|
+
return lowerToolId.includes("edit") || lowerToolId.includes("create") || lowerToolId.includes("replace") || lowerToolId.includes("patch");
|
|
45
|
+
}
|
|
46
|
+
function isGenericEditToolId(toolId) {
|
|
47
|
+
const lowerToolId = toolId.toLowerCase();
|
|
48
|
+
if (lowerToolId.includes("create") || lowerToolId.includes("notebook")) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
return lowerToolId.includes("replace") || lowerToolId.includes("patch") || lowerToolId.includes("insertedit") || lowerToolId.includes("insert_edit") || lowerToolId.includes("editfile");
|
|
52
|
+
}
|
|
53
|
+
function getToolInvocationIcon(toolId, registeredIcon) {
|
|
54
|
+
if (registeredIcon) {
|
|
55
|
+
return registeredIcon;
|
|
56
|
+
}
|
|
40
57
|
const lowerToolId = toolId.toLowerCase();
|
|
41
58
|
if (lowerToolId.includes("search") || lowerToolId.includes("grep") || lowerToolId.includes("find") || lowerToolId.includes("list") || lowerToolId.includes("semantic") || lowerToolId.includes("changes") || lowerToolId.includes("codebase")) {
|
|
42
59
|
return Codicon.search;
|
|
@@ -44,7 +61,7 @@ function getToolInvocationIcon(toolId) {
|
|
|
44
61
|
if (lowerToolId.includes("read") || lowerToolId.includes("get_file") || lowerToolId.includes("problems")) {
|
|
45
62
|
return Codicon.book;
|
|
46
63
|
}
|
|
47
|
-
if (
|
|
64
|
+
if (isEditToolId(toolId)) {
|
|
48
65
|
return Codicon.pencil;
|
|
49
66
|
}
|
|
50
67
|
if (lowerToolId.includes("terminal")) {
|
|
@@ -68,38 +85,40 @@ var WorkingMessageCategory;
|
|
|
68
85
|
WorkingMessageCategory["Terminal"] = "terminal";
|
|
69
86
|
WorkingMessageCategory["Tool"] = "tool";
|
|
70
87
|
})(WorkingMessageCategory || (WorkingMessageCategory = {}));
|
|
71
|
-
const defaultThinkingMessages = [( localize(
|
|
72
|
-
const terminalMessages = [( localize(
|
|
73
|
-
const toolMessages = [( localize(
|
|
74
|
-
|
|
88
|
+
const defaultThinkingMessages = [( localize(6783, "Thinking")), ( localize(6784, "Reasoning")), ( localize(6785, "Considering")), ( localize(6786, "Analyzing")), ( localize(6787, "Evaluating"))];
|
|
89
|
+
const terminalMessages = [( localize(6788, "Executing")), ( localize(6789, "Running")), ( localize(6790, "Processing"))];
|
|
90
|
+
const toolMessages = [( localize(6791, "Processing")), ( localize(6792, "Preparing")), ( localize(6793, "Loading")), ( localize(6794, "Analyzing")), ( localize(6795, "Evaluating"))];
|
|
91
|
+
function buildPhrasePool(defaults, configurationService) {
|
|
92
|
+
const config = configurationService.getValue(ChatConfiguration.ThinkingPhrases);
|
|
93
|
+
const customPhrases = Array.isArray(config?.phrases) ? ( config.phrases.filter(phrase => typeof phrase === "string").map(phrase => phrase.trim())).filter(phrase => phrase.length > 0) : [];
|
|
94
|
+
if (customPhrases.length > 0) {
|
|
95
|
+
return config?.mode === "replace" ? [...customPhrases] : [...defaults, ...customPhrases];
|
|
96
|
+
}
|
|
97
|
+
return [...defaults];
|
|
98
|
+
}
|
|
99
|
+
let ChatThinkingContentPart = ChatThinkingContentPart_1 = class ChatThinkingContentPart extends ChatCollapsibleContentPart {
|
|
100
|
+
static _codeBlockRendererSync(_languageId, text, _raw) {
|
|
101
|
+
const codeElement = $("code");
|
|
102
|
+
codeElement.textContent = text;
|
|
103
|
+
return codeElement;
|
|
104
|
+
}
|
|
75
105
|
getRandomWorkingMessage(category = WorkingMessageCategory.Tool) {
|
|
76
106
|
let pool = this.availableMessagesByCategory.get(category);
|
|
77
107
|
if (!pool || pool.length === 0) {
|
|
78
108
|
let defaults;
|
|
79
109
|
switch (category) {
|
|
80
110
|
case WorkingMessageCategory.Thinking:
|
|
81
|
-
defaults =
|
|
111
|
+
defaults = defaultThinkingMessages;
|
|
82
112
|
break;
|
|
83
113
|
case WorkingMessageCategory.Terminal:
|
|
84
|
-
defaults =
|
|
114
|
+
defaults = terminalMessages;
|
|
85
115
|
break;
|
|
86
116
|
case WorkingMessageCategory.Tool:
|
|
87
117
|
default:
|
|
88
|
-
defaults =
|
|
118
|
+
defaults = toolMessages;
|
|
89
119
|
break;
|
|
90
120
|
}
|
|
91
|
-
|
|
92
|
-
const customPhrases = Array.isArray(config?.phrases) ? ( config.phrases.filter(phrase => typeof phrase === "string").map(phrase => phrase.trim())).filter(phrase => phrase.length > 0) : [];
|
|
93
|
-
const mode = config?.mode === "replace" ? "replace" : "append";
|
|
94
|
-
if (customPhrases.length > 0) {
|
|
95
|
-
if (mode === "replace") {
|
|
96
|
-
pool = [...customPhrases];
|
|
97
|
-
} else {
|
|
98
|
-
pool = [...defaults, ...customPhrases];
|
|
99
|
-
}
|
|
100
|
-
} else {
|
|
101
|
-
pool = defaults;
|
|
102
|
-
}
|
|
121
|
+
pool = buildPhrasePool(defaults, this.configurationService);
|
|
103
122
|
this.availableMessagesByCategory.set(category, pool);
|
|
104
123
|
}
|
|
105
124
|
const index = Math.floor(Math.random() * pool.length);
|
|
@@ -117,7 +136,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
117
136
|
hoverService
|
|
118
137
|
) {
|
|
119
138
|
const initialText = extractTextFromPart(content);
|
|
120
|
-
const extractedTitle = extractTitleFromThinkingContent(initialText) ?? "
|
|
139
|
+
const extractedTitle = extractTitleFromThinkingContent(initialText) ?? ( localize(6796, "Thinking"));
|
|
121
140
|
super(extractedTitle, context, undefined, hoverService, configurationService);
|
|
122
141
|
this.chatContentMarkdownRenderer = chatContentMarkdownRenderer;
|
|
123
142
|
this.streamingCompleted = streamingCompleted;
|
|
@@ -126,7 +145,10 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
126
145
|
this.chatMarkdownAnchorService = chatMarkdownAnchorService;
|
|
127
146
|
this.languageModelsService = languageModelsService;
|
|
128
147
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
129
|
-
this.
|
|
148
|
+
this._asyncRenderCallback = () => this._onDidChangeHeight.fire();
|
|
149
|
+
this.defaultTitle = ( localize(6797, "Thinking"));
|
|
150
|
+
this.workingTitle = ( localize(6798, "Working"));
|
|
151
|
+
this._markdownResult = this._register(( new MutableDisposable()));
|
|
130
152
|
this.fixedScrollingMode = false;
|
|
131
153
|
this.autoScrollEnabled = true;
|
|
132
154
|
this.extractedTitles = [];
|
|
@@ -140,9 +162,15 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
140
162
|
this.hasExpandedOnce = false;
|
|
141
163
|
this.availableMessagesByCategory = ( new Map());
|
|
142
164
|
this.toolWrappersByCallId = ( new Map());
|
|
165
|
+
this.toolIconsByCallId = ( new Map());
|
|
166
|
+
this.toolLabelsByCallId = ( new Map());
|
|
143
167
|
this.toolDisposables = this._register(( new DisposableMap()));
|
|
168
|
+
this.ownedToolParts = ( new Map());
|
|
144
169
|
this.pendingRemovals = [];
|
|
145
170
|
this.isUpdatingDimensions = false;
|
|
171
|
+
this.lastKnownContentHeight = 0;
|
|
172
|
+
this.lastKnownScrollTop = 0;
|
|
173
|
+
this._titleDetailRendered = this._register(( new MutableDisposable()));
|
|
146
174
|
this.id = content.id;
|
|
147
175
|
this.content = content;
|
|
148
176
|
this.allThinkingParts.push(content);
|
|
@@ -157,7 +185,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
157
185
|
this.appendedItemCount++;
|
|
158
186
|
}
|
|
159
187
|
if (this.configurationService.getValue(AccessibilityWorkbenchSettingId.VerboseChatProgressUpdates)) {
|
|
160
|
-
alert(( localize(
|
|
188
|
+
alert(( localize(6799, "Thinking")));
|
|
161
189
|
}
|
|
162
190
|
if (configuredMode === ThinkingDisplayMode.Collapsed) {
|
|
163
191
|
this.setExpanded(false);
|
|
@@ -168,6 +196,13 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
168
196
|
}
|
|
169
197
|
const node = this.domNode;
|
|
170
198
|
node.classList.add("chat-thinking-box");
|
|
199
|
+
this._externalResourceWidget = this._register(
|
|
200
|
+
this.instantiationService.createInstance(ChatThinkingExternalResourceWidget)
|
|
201
|
+
);
|
|
202
|
+
this._register(
|
|
203
|
+
this._externalResourceWidget.onDidChangeHeight(() => this._onDidChangeHeight.fire())
|
|
204
|
+
);
|
|
205
|
+
node.appendChild(this._externalResourceWidget.domNode);
|
|
171
206
|
if (!this.streamingCompleted && !this.element.isComplete) {
|
|
172
207
|
if (!this.fixedScrollingMode) {
|
|
173
208
|
node.classList.add("chat-thinking-active");
|
|
@@ -184,6 +219,12 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
184
219
|
node.classList.add("chat-thinking-fixed-mode");
|
|
185
220
|
this.currentTitle = this.defaultTitle;
|
|
186
221
|
}
|
|
222
|
+
this._register(toDisposable(() => {
|
|
223
|
+
for (const d of ( this.ownedToolParts.values())) {
|
|
224
|
+
d.dispose();
|
|
225
|
+
}
|
|
226
|
+
this.ownedToolParts.clear();
|
|
227
|
+
}));
|
|
187
228
|
this._register(autorun(r => {
|
|
188
229
|
const isExpanded = this.expanded.read(r);
|
|
189
230
|
if (this._collapseButton) {
|
|
@@ -202,14 +243,16 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
202
243
|
const isExpanded = this._isExpanded.read(r);
|
|
203
244
|
if (isExpanded && !this.hasExpandedOnce && this.lazyItems.length > 0) {
|
|
204
245
|
this.hasExpandedOnce = true;
|
|
246
|
+
this.processPendingRemovals();
|
|
205
247
|
for (const item of this.lazyItems) {
|
|
206
248
|
this.materializeLazyItem(item);
|
|
207
249
|
}
|
|
208
250
|
}
|
|
209
|
-
if (isExpanded && !this.shouldAllowExpansion()) {
|
|
251
|
+
if (isExpanded && !this.shouldAllowExpansion() && (this.streamingCompleted || this.element.isComplete)) {
|
|
210
252
|
this.setExpanded(false);
|
|
211
253
|
return;
|
|
212
254
|
}
|
|
255
|
+
this._externalResourceWidget.setCollapsed(!isExpanded);
|
|
213
256
|
this._onDidChangeHeight.fire();
|
|
214
257
|
}));
|
|
215
258
|
const label = this.lastExtractedTitle ?? "";
|
|
@@ -268,7 +311,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
268
311
|
})));
|
|
269
312
|
this._register(this.scrollableElement.onScroll(e => this.handleScroll(e.scrollTop)));
|
|
270
313
|
const mutationObserver = new mainWindow.MutationObserver(() => {
|
|
271
|
-
if (!this.streamingCompleted) {
|
|
314
|
+
if (!this.streamingCompleted && this.domNode.classList.contains("chat-used-context-collapsed")) {
|
|
272
315
|
this.syncDimensionsAndScheduleScroll();
|
|
273
316
|
}
|
|
274
317
|
});
|
|
@@ -295,26 +338,29 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
295
338
|
if (!this.scrollableElement || this.isUpdatingDimensions) {
|
|
296
339
|
return;
|
|
297
340
|
}
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
this.autoScrollEnabled = false;
|
|
305
|
-
}
|
|
341
|
+
this.lastKnownScrollTop = scrollTop;
|
|
342
|
+
const contentHeight = this.lastKnownContentHeight;
|
|
343
|
+
const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
|
|
344
|
+
const maxScrollTop = contentHeight - viewportHeight;
|
|
345
|
+
this.autoScrollEnabled = maxScrollTop <= 0 || scrollTop >= maxScrollTop - 10;
|
|
346
|
+
this.updateFadeClasses(scrollTop, contentHeight, viewportHeight);
|
|
306
347
|
}
|
|
307
|
-
|
|
308
|
-
if (this.
|
|
309
|
-
this.
|
|
310
|
-
try {
|
|
311
|
-
this.updateScrollDimensions();
|
|
312
|
-
this.scrollToBottom();
|
|
313
|
-
} finally {
|
|
314
|
-
this.isUpdatingDimensions = false;
|
|
315
|
-
}
|
|
348
|
+
updateFadeClasses(scrollTop, contentHeight, viewportHeight) {
|
|
349
|
+
if (!this.fixedScrollingMode || this.streamingCompleted) {
|
|
350
|
+
this.domNode.classList.remove("chat-thinking-fade-top", "chat-thinking-fade-bottom");
|
|
316
351
|
return;
|
|
317
352
|
}
|
|
353
|
+
const currentScrollTop = scrollTop ?? this.lastKnownScrollTop;
|
|
354
|
+
const currentContentHeight = contentHeight ?? this.lastKnownContentHeight;
|
|
355
|
+
const currentViewportHeight = viewportHeight ?? Math.min(currentContentHeight, THINKING_SCROLL_MAX_HEIGHT);
|
|
356
|
+
const maxScrollTop = currentContentHeight - currentViewportHeight;
|
|
357
|
+
this.domNode.classList.toggle("chat-thinking-fade-top", currentScrollTop > 5);
|
|
358
|
+
this.domNode.classList.toggle(
|
|
359
|
+
"chat-thinking-fade-bottom",
|
|
360
|
+
maxScrollTop > 0 && currentScrollTop < maxScrollTop - 5
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
syncDimensionsAndScheduleScroll() {
|
|
318
364
|
if (this.pendingScrollDisposable) {
|
|
319
365
|
return;
|
|
320
366
|
}
|
|
@@ -325,21 +371,26 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
325
371
|
}
|
|
326
372
|
this.isUpdatingDimensions = true;
|
|
327
373
|
try {
|
|
328
|
-
this.updateScrollDimensions();
|
|
374
|
+
const contentHeight = this.updateScrollDimensions();
|
|
375
|
+
if (this.autoScrollEnabled && contentHeight !== undefined) {
|
|
376
|
+
this.scrollToBottom(contentHeight);
|
|
377
|
+
}
|
|
329
378
|
} finally {
|
|
330
379
|
this.isUpdatingDimensions = false;
|
|
331
380
|
}
|
|
381
|
+
this.updateFadeClasses(this.lastKnownScrollTop, this.lastKnownContentHeight);
|
|
332
382
|
});
|
|
333
383
|
}
|
|
334
384
|
updateScrollDimensions() {
|
|
335
385
|
if (!this.scrollableElement) {
|
|
336
|
-
return;
|
|
386
|
+
return undefined;
|
|
337
387
|
}
|
|
338
388
|
const isCollapsed = this.domNode.classList.contains("chat-used-context-collapsed");
|
|
339
389
|
if (!isCollapsed) {
|
|
340
|
-
return;
|
|
390
|
+
return undefined;
|
|
341
391
|
}
|
|
342
392
|
const contentHeight = this.wrapper.scrollHeight;
|
|
393
|
+
this.lastKnownContentHeight = contentHeight;
|
|
343
394
|
const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
|
|
344
395
|
this.scrollableElement.setScrollDimensions({
|
|
345
396
|
width: this.scrollableElement.getDomNode().clientWidth,
|
|
@@ -347,17 +398,20 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
347
398
|
height: viewportHeight,
|
|
348
399
|
scrollHeight: contentHeight
|
|
349
400
|
});
|
|
401
|
+
this.lastKnownScrollTop = this.scrollableElement.getScrollPosition().scrollTop;
|
|
350
402
|
this.updateDropdownClickability(contentHeight);
|
|
403
|
+
return contentHeight;
|
|
351
404
|
}
|
|
352
|
-
scrollToBottom() {
|
|
405
|
+
scrollToBottom(contentHeight) {
|
|
353
406
|
if (!this.scrollableElement) {
|
|
354
407
|
return;
|
|
355
408
|
}
|
|
356
|
-
const contentHeight = this.wrapper.scrollHeight;
|
|
357
409
|
const viewportHeight = Math.min(contentHeight, THINKING_SCROLL_MAX_HEIGHT);
|
|
358
410
|
if (contentHeight > viewportHeight) {
|
|
411
|
+
const newScrollTop = contentHeight - viewportHeight;
|
|
412
|
+
this.lastKnownScrollTop = newScrollTop;
|
|
359
413
|
this.scrollableElement.setScrollPosition({
|
|
360
|
-
scrollTop:
|
|
414
|
+
scrollTop: newScrollTop
|
|
361
415
|
});
|
|
362
416
|
}
|
|
363
417
|
}
|
|
@@ -385,10 +439,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
385
439
|
}
|
|
386
440
|
const cleanedContent = content.trim();
|
|
387
441
|
if (!cleanedContent) {
|
|
388
|
-
|
|
389
|
-
this.markdownResult.dispose();
|
|
390
|
-
this.markdownResult = undefined;
|
|
391
|
-
}
|
|
442
|
+
this._markdownResult.clear();
|
|
392
443
|
if (this.textContainer) {
|
|
393
444
|
clearNode(this.textContainer);
|
|
394
445
|
}
|
|
@@ -398,21 +449,13 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
398
449
|
if (cleanedContent.startsWith("**") && cleanedContent.endsWith("**")) {
|
|
399
450
|
contentToRender = cleanedContent.slice(2, -2);
|
|
400
451
|
}
|
|
401
|
-
const target = reuseExisting ? this.
|
|
402
|
-
|
|
403
|
-
this.markdownResult.dispose();
|
|
404
|
-
this.markdownResult = undefined;
|
|
405
|
-
}
|
|
406
|
-
const rendered = this._register(this.chatContentMarkdownRenderer.render(( new MarkdownString(contentToRender)), {
|
|
452
|
+
const target = reuseExisting ? this._markdownResult.value?.element : undefined;
|
|
453
|
+
const rendered = this.chatContentMarkdownRenderer.render(( new MarkdownString(contentToRender)), {
|
|
407
454
|
fillInIncompleteTokens: true,
|
|
408
|
-
asyncRenderCallback:
|
|
409
|
-
codeBlockRendererSync:
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
return codeElement;
|
|
413
|
-
}
|
|
414
|
-
}, target));
|
|
415
|
-
this.markdownResult = rendered;
|
|
455
|
+
asyncRenderCallback: this._asyncRenderCallback,
|
|
456
|
+
codeBlockRendererSync: ChatThinkingContentPart_1._codeBlockRendererSync
|
|
457
|
+
}, target);
|
|
458
|
+
this._markdownResult.value = rendered;
|
|
416
459
|
if (!target) {
|
|
417
460
|
if (this.textContainer) {
|
|
418
461
|
clearNode(this.textContainer);
|
|
@@ -476,7 +519,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
476
519
|
allowExpansion = false;
|
|
477
520
|
}
|
|
478
521
|
}
|
|
479
|
-
if (!allowExpansion && this.isExpanded()) {
|
|
522
|
+
if (!allowExpansion && this.isExpanded() && (this.streamingCompleted || this.element.isComplete)) {
|
|
480
523
|
this.setExpanded(false);
|
|
481
524
|
}
|
|
482
525
|
this.setDropdownClickable(allowExpansion);
|
|
@@ -514,7 +557,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
514
557
|
return;
|
|
515
558
|
}
|
|
516
559
|
const previousValue = this.currentThinkingValue;
|
|
517
|
-
const reuseExisting = !!(this.
|
|
560
|
+
const reuseExisting = !!(this._markdownResult.value && next.startsWith(previousValue) && next.length > previousValue.length);
|
|
518
561
|
this.currentThinkingValue = next;
|
|
519
562
|
this.renderMarkdown(next, reuseExisting);
|
|
520
563
|
if (this.fixedScrollingMode && this.scrollableElement) {
|
|
@@ -539,15 +582,28 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
539
582
|
getIsActive() {
|
|
540
583
|
return this.isActive;
|
|
541
584
|
}
|
|
585
|
+
isEffectivelyEmpty() {
|
|
586
|
+
if (this.toolInvocationCount > 0 || this.lazyItems.length > 0 || this.hookCount > 0) {
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
if (this.currentThinkingValue.trim().length > 0) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
return true;
|
|
593
|
+
}
|
|
542
594
|
markAsInactive() {
|
|
543
595
|
this.isActive = false;
|
|
544
596
|
this.domNode.classList.remove("chat-thinking-active");
|
|
597
|
+
this.domNode.classList.remove("chat-thinking-fade-top", "chat-thinking-fade-bottom");
|
|
545
598
|
this.processPendingRemovals();
|
|
546
599
|
if (this.workingSpinnerElement) {
|
|
547
600
|
this.workingSpinnerElement.remove();
|
|
548
601
|
this.workingSpinnerElement = undefined;
|
|
549
602
|
this.workingSpinnerLabel = undefined;
|
|
550
603
|
}
|
|
604
|
+
for (const toolInvocation of this.toolInvocations) {
|
|
605
|
+
toolInvocation.isAttachedToThinking = false;
|
|
606
|
+
}
|
|
551
607
|
}
|
|
552
608
|
finalizeTitleIfDefault() {
|
|
553
609
|
this.processPendingRemovals();
|
|
@@ -555,6 +611,7 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
555
611
|
this.wrapper.classList.remove("chat-thinking-streaming");
|
|
556
612
|
}
|
|
557
613
|
this.domNode.classList.remove("chat-thinking-active");
|
|
614
|
+
this.domNode.classList.remove("chat-thinking-fade-top", "chat-thinking-fade-bottom");
|
|
558
615
|
this.streamingCompleted = true;
|
|
559
616
|
if (this.mutationObserverDisposable) {
|
|
560
617
|
this.mutationObserverDisposable.dispose();
|
|
@@ -583,22 +640,30 @@ let ChatThinkingContentPart = class ChatThinkingContentPart extends ChatCollapsi
|
|
|
583
640
|
this.setFinalizedTitle(existingTitle);
|
|
584
641
|
return;
|
|
585
642
|
}
|
|
586
|
-
if (this.
|
|
643
|
+
if (this.toolInvocationCount === 1 && this.hookCount === 0 && this.currentThinkingValue.trim() === "") {
|
|
587
644
|
if (!this.singleItemInfo) {
|
|
588
645
|
const lazyItem = this.lazyItems.find(item => item.kind === "tool" && item.originalParent);
|
|
589
646
|
if (lazyItem && lazyItem.kind === "tool") {
|
|
647
|
+
const toolInvocation = lazyItem.toolInvocationOrMarkdown && (lazyItem.toolInvocationOrMarkdown.kind === "toolInvocation" || lazyItem.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? lazyItem.toolInvocationOrMarkdown : undefined;
|
|
590
648
|
const result = lazyItem.lazy.value;
|
|
591
649
|
this.singleItemInfo = {
|
|
592
650
|
element: result.domNode,
|
|
593
651
|
originalParent: lazyItem.originalParent,
|
|
594
|
-
originalNextSibling: this.domNode
|
|
652
|
+
originalNextSibling: this.domNode,
|
|
653
|
+
toolInvocation
|
|
595
654
|
};
|
|
596
655
|
if (result.disposable) {
|
|
597
|
-
|
|
656
|
+
const toolCallId = toolInvocation?.toolCallId;
|
|
657
|
+
if (toolCallId) {
|
|
658
|
+
this.ownedToolParts.set(toolCallId, result.disposable);
|
|
659
|
+
} else {
|
|
660
|
+
this._register(result.disposable);
|
|
661
|
+
}
|
|
598
662
|
}
|
|
599
663
|
}
|
|
600
664
|
}
|
|
601
|
-
|
|
665
|
+
const toolIsComplete = !this.singleItemInfo?.toolInvocation || IChatToolInvocation.isComplete(this.singleItemInfo.toolInvocation);
|
|
666
|
+
if (toolIsComplete && this.singleItemInfo && this.restoreSingleItemToOriginalPosition()) {
|
|
602
667
|
return;
|
|
603
668
|
}
|
|
604
669
|
}
|
|
@@ -790,7 +855,8 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
790
855
|
const {
|
|
791
856
|
element,
|
|
792
857
|
originalParent,
|
|
793
|
-
originalNextSibling
|
|
858
|
+
originalNextSibling,
|
|
859
|
+
toolInvocation
|
|
794
860
|
} = this.singleItemInfo;
|
|
795
861
|
if (element.childElementCount > 1) {
|
|
796
862
|
this.singleItemInfo = undefined;
|
|
@@ -801,17 +867,20 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
801
867
|
} else {
|
|
802
868
|
originalParent.appendChild(element);
|
|
803
869
|
}
|
|
870
|
+
if (toolInvocation) {
|
|
871
|
+
toolInvocation.isAttachedToThinking = false;
|
|
872
|
+
}
|
|
804
873
|
hide(this.domNode);
|
|
805
874
|
this.singleItemInfo = undefined;
|
|
806
875
|
return true;
|
|
807
876
|
}
|
|
808
877
|
setFallbackTitle() {
|
|
809
878
|
const finalLabel = this.appendedItemCount > 0 ? ( localize(
|
|
810
|
-
|
|
879
|
+
6800,
|
|
811
880
|
"Finished with {0} step{1}",
|
|
812
881
|
this.appendedItemCount,
|
|
813
882
|
this.appendedItemCount === 1 ? "" : "s"
|
|
814
|
-
)) : ( localize(
|
|
883
|
+
)) : ( localize(6801, "Finished Working"));
|
|
815
884
|
this.currentTitle = finalLabel;
|
|
816
885
|
if (this.wrapper) {
|
|
817
886
|
this.wrapper.classList.remove("chat-thinking-streaming");
|
|
@@ -839,7 +908,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
839
908
|
if (result.disposable) {
|
|
840
909
|
const toolCallId = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? toolInvocationOrMarkdown.toolCallId : undefined;
|
|
841
910
|
if (toolCallId) {
|
|
842
|
-
this.
|
|
911
|
+
this.ownedToolParts.set(toolCallId, result.disposable);
|
|
843
912
|
} else {
|
|
844
913
|
this._register(result.disposable);
|
|
845
914
|
}
|
|
@@ -857,6 +926,34 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
857
926
|
}
|
|
858
927
|
this.updateDropdownClickability();
|
|
859
928
|
}
|
|
929
|
+
removeMaterializedItem(toolCallId) {
|
|
930
|
+
this.toolDisposables.deleteAndDispose(toolCallId);
|
|
931
|
+
this.ownedToolParts.delete(toolCallId);
|
|
932
|
+
const wrapper = this.toolWrappersByCallId.get(toolCallId);
|
|
933
|
+
if (wrapper) {
|
|
934
|
+
this.toolWrappersByCallId.delete(toolCallId);
|
|
935
|
+
this.toolIconsByCallId.delete(toolCallId);
|
|
936
|
+
}
|
|
937
|
+
this.appendedItemCount = Math.max(0, this.appendedItemCount - 1);
|
|
938
|
+
this.toolInvocationCount = Math.max(0, this.toolInvocationCount - 1);
|
|
939
|
+
const toolInvocationsIndex = this.toolInvocations.findIndex(
|
|
940
|
+
t => (t.kind === "toolInvocation" || t.kind === "toolInvocationSerialized") && t.toolCallId === toolCallId
|
|
941
|
+
);
|
|
942
|
+
if (toolInvocationsIndex !== -1) {
|
|
943
|
+
const label = this.toolLabelsByCallId.get(toolCallId);
|
|
944
|
+
if (label) {
|
|
945
|
+
const titleIndex = this.extractedTitles.indexOf(label);
|
|
946
|
+
if (titleIndex !== -1) {
|
|
947
|
+
this.extractedTitles.splice(titleIndex, 1);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
this.toolInvocations.splice(toolInvocationsIndex, 1);
|
|
951
|
+
}
|
|
952
|
+
this.toolLabelsByCallId.delete(toolCallId);
|
|
953
|
+
this._externalResourceWidget.removeToolInvocation(toolCallId);
|
|
954
|
+
this.updateDropdownClickability();
|
|
955
|
+
this._onDidChangeHeight.fire();
|
|
956
|
+
}
|
|
860
957
|
removeLazyItem(toolInvocationId) {
|
|
861
958
|
const index = this.lazyItems.findIndex(item => item.kind === "tool" && item.toolInvocationId === toolInvocationId);
|
|
862
959
|
if (index === -1) {
|
|
@@ -870,6 +967,19 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
870
967
|
} else {
|
|
871
968
|
this.toolInvocationCount--;
|
|
872
969
|
}
|
|
970
|
+
if (removedItem.kind === "tool" && removedItem.toolInvocationOrMarkdown && (removedItem.toolInvocationOrMarkdown.kind === "toolInvocation" || removedItem.toolInvocationOrMarkdown.kind === "toolInvocationSerialized")) {
|
|
971
|
+
removedItem.toolInvocationOrMarkdown.isAttachedToThinking = false;
|
|
972
|
+
const toolCallId = removedItem.toolInvocationOrMarkdown.toolCallId;
|
|
973
|
+
this._externalResourceWidget.removeToolInvocation(toolCallId);
|
|
974
|
+
const label = this.toolLabelsByCallId.get(toolCallId);
|
|
975
|
+
if (label) {
|
|
976
|
+
const titleIndex = this.extractedTitles.indexOf(label);
|
|
977
|
+
if (titleIndex !== -1) {
|
|
978
|
+
this.extractedTitles.splice(titleIndex, 1);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
this.toolLabelsByCallId.delete(toolCallId);
|
|
982
|
+
}
|
|
873
983
|
const toolInvocationsIndex = this.toolInvocations.findIndex(
|
|
874
984
|
t => (t.kind === "toolInvocation" || t.kind === "toolInvocationSerialized") && t.toolId === toolInvocationId
|
|
875
985
|
);
|
|
@@ -905,15 +1015,22 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
905
1015
|
}
|
|
906
1016
|
removeStreamingToolEntry(toolCallId, toolLabel) {
|
|
907
1017
|
this.toolDisposables.deleteAndDispose(toolCallId);
|
|
1018
|
+
this.ownedToolParts.get(toolCallId)?.dispose();
|
|
1019
|
+
this.ownedToolParts.delete(toolCallId);
|
|
908
1020
|
const wrapper = this.toolWrappersByCallId.get(toolCallId);
|
|
909
1021
|
if (wrapper) {
|
|
910
1022
|
wrapper.remove();
|
|
911
1023
|
this.toolWrappersByCallId.delete(toolCallId);
|
|
1024
|
+
this.toolIconsByCallId.delete(toolCallId);
|
|
912
1025
|
}
|
|
913
1026
|
const lazyIndex = this.lazyItems.findIndex(
|
|
914
1027
|
item => item.kind === "tool" && item.toolInvocationOrMarkdown && (item.toolInvocationOrMarkdown.kind === "toolInvocation" || item.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && item.toolInvocationOrMarkdown.toolCallId === toolCallId
|
|
915
1028
|
);
|
|
916
1029
|
if (lazyIndex !== -1) {
|
|
1030
|
+
const removedLazyItem = this.lazyItems[lazyIndex];
|
|
1031
|
+
if (removedLazyItem.kind === "tool" && removedLazyItem.toolInvocationOrMarkdown && (removedLazyItem.toolInvocationOrMarkdown.kind === "toolInvocation" || removedLazyItem.toolInvocationOrMarkdown.kind === "toolInvocationSerialized")) {
|
|
1032
|
+
removedLazyItem.toolInvocationOrMarkdown.isAttachedToThinking = false;
|
|
1033
|
+
}
|
|
917
1034
|
this.lazyItems.splice(lazyIndex, 1);
|
|
918
1035
|
}
|
|
919
1036
|
this.appendedItemCount = Math.max(0, this.appendedItemCount - 1);
|
|
@@ -928,6 +1045,8 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
928
1045
|
if (titleIndex !== -1) {
|
|
929
1046
|
this.extractedTitles.splice(titleIndex, 1);
|
|
930
1047
|
}
|
|
1048
|
+
this.toolLabelsByCallId.delete(toolCallId);
|
|
1049
|
+
this._externalResourceWidget.removeToolInvocation(toolCallId);
|
|
931
1050
|
this.updateDropdownClickability();
|
|
932
1051
|
this._onDidChangeHeight.fire();
|
|
933
1052
|
}
|
|
@@ -941,12 +1060,25 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
941
1060
|
} else {
|
|
942
1061
|
this.toolInvocationCount++;
|
|
943
1062
|
}
|
|
1063
|
+
if (this.toolInvocationCount === 1) {
|
|
1064
|
+
this.defaultTitle = this.workingTitle;
|
|
1065
|
+
}
|
|
944
1066
|
let toolCallLabel;
|
|
945
1067
|
const isToolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized");
|
|
946
1068
|
if (isToolInvocation && toolInvocationOrMarkdown.invocationMessage) {
|
|
947
1069
|
const message = typeof toolInvocationOrMarkdown.invocationMessage === "string" ? toolInvocationOrMarkdown.invocationMessage : toolInvocationOrMarkdown.invocationMessage.value;
|
|
948
|
-
|
|
1070
|
+
const isStreamingEditTool = toolInvocationOrMarkdown.kind === "toolInvocation" && IChatToolInvocation.isStreaming(toolInvocationOrMarkdown) && isGenericEditToolId(toolInvocationOrMarkdown.toolId);
|
|
1071
|
+
if (isStreamingEditTool) {
|
|
1072
|
+
toolCallLabel = ( localize(6802, "Editing files"));
|
|
1073
|
+
} else {
|
|
1074
|
+
toolCallLabel = message;
|
|
1075
|
+
}
|
|
949
1076
|
this.toolInvocations.push(toolInvocationOrMarkdown);
|
|
1077
|
+
const toolCallId = toolInvocationOrMarkdown.toolCallId;
|
|
1078
|
+
this.toolLabelsByCallId.set(toolCallId, toolCallLabel);
|
|
1079
|
+
if (toolInvocationOrMarkdown.kind === "toolInvocationSerialized") {
|
|
1080
|
+
this.updateExternalResourceParts(toolInvocationOrMarkdown);
|
|
1081
|
+
}
|
|
950
1082
|
if (toolInvocationOrMarkdown.kind === "toolInvocation") {
|
|
951
1083
|
let currentToolLabel = toolCallLabel;
|
|
952
1084
|
let isComplete = false;
|
|
@@ -967,6 +1099,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
967
1099
|
this.extractedTitles.push(updatedMessage);
|
|
968
1100
|
}
|
|
969
1101
|
currentToolLabel = updatedMessage;
|
|
1102
|
+
this.toolLabelsByCallId.set(toolCallId, updatedMessage);
|
|
970
1103
|
this.lastExtractedTitle = updatedMessage;
|
|
971
1104
|
if (!this.fixedScrollingMode && !this._isExpanded.read(undefined)) {
|
|
972
1105
|
this.setTitle(updatedMessage);
|
|
@@ -980,6 +1113,15 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
980
1113
|
const currentState = toolInvocationOrMarkdown.state.read(reader);
|
|
981
1114
|
if (isStreaming && currentState.type !== IChatToolInvocation.StateKind.Streaming) {
|
|
982
1115
|
isStreaming = false;
|
|
1116
|
+
const termData = toolInvocationOrMarkdown.toolSpecificData;
|
|
1117
|
+
if (termData?.kind === "terminal") {
|
|
1118
|
+
const iconEl = this.toolIconsByCallId.get(toolCallId);
|
|
1119
|
+
if (iconEl) {
|
|
1120
|
+
const newIcon = termData.commandLine?.isSandboxWrapped ? Codicon.terminalSecure : Codicon.terminal;
|
|
1121
|
+
iconEl.className = "chat-thinking-icon";
|
|
1122
|
+
iconEl.classList.add(...ThemeIcon.asClassNameArray(newIcon));
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
983
1125
|
if (toolInvocationOrMarkdown.presentation === "hidden") {
|
|
984
1126
|
this.pendingRemovals.push({
|
|
985
1127
|
toolCallId: toolInvocationOrMarkdown.toolCallId,
|
|
@@ -991,6 +1133,16 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
991
1133
|
}
|
|
992
1134
|
}
|
|
993
1135
|
if (currentState.type === IChatToolInvocation.StateKind.Completed || currentState.type === IChatToolInvocation.StateKind.Cancelled) {
|
|
1136
|
+
if (toolInvocationOrMarkdown.presentation === "hidden" || toolInvocationOrMarkdown.presentation === "hiddenAfterComplete") {
|
|
1137
|
+
this.pendingRemovals.push({
|
|
1138
|
+
toolCallId: toolInvocationOrMarkdown.toolCallId,
|
|
1139
|
+
toolLabel: currentToolLabel
|
|
1140
|
+
});
|
|
1141
|
+
this.schedulePendingRemovalsFlush();
|
|
1142
|
+
}
|
|
1143
|
+
if (currentState.type === IChatToolInvocation.StateKind.Completed) {
|
|
1144
|
+
this.updateExternalResourceParts(toolInvocationOrMarkdown);
|
|
1145
|
+
}
|
|
994
1146
|
isComplete = true;
|
|
995
1147
|
return;
|
|
996
1148
|
}
|
|
@@ -1029,9 +1181,9 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1029
1181
|
const codeblockInfo = extractCodeblockUrisFromText(toolInvocationOrMarkdown.content.value);
|
|
1030
1182
|
if (codeblockInfo?.uri) {
|
|
1031
1183
|
const filename = basename(codeblockInfo.uri);
|
|
1032
|
-
toolCallLabel = ( localize(
|
|
1184
|
+
toolCallLabel = ( localize(6803, "Edited {0}", filename));
|
|
1033
1185
|
} else {
|
|
1034
|
-
toolCallLabel = ( localize(
|
|
1186
|
+
toolCallLabel = ( localize(6804, "Edited file"));
|
|
1035
1187
|
}
|
|
1036
1188
|
} else {
|
|
1037
1189
|
toolCallLabel = toolInvocationId;
|
|
@@ -1044,15 +1196,30 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1044
1196
|
this.setTitle(toolCallLabel);
|
|
1045
1197
|
}
|
|
1046
1198
|
}
|
|
1199
|
+
updateExternalResourceParts(toolInvocation) {
|
|
1200
|
+
const extractedImages = extractImagesFromToolInvocationOutputDetails(toolInvocation, this.element.sessionResource);
|
|
1201
|
+
if (extractedImages.length === 0) {
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
const parts = ( extractedImages.map(image => ({
|
|
1205
|
+
kind: "data",
|
|
1206
|
+
value: image.data.buffer,
|
|
1207
|
+
mimeType: image.mimeType,
|
|
1208
|
+
uri: image.uri
|
|
1209
|
+
})));
|
|
1210
|
+
this._externalResourceWidget.setToolInvocationParts(toolInvocation.toolCallId, parts);
|
|
1211
|
+
}
|
|
1047
1212
|
appendItemToDOM(content, toolInvocationId, toolInvocationOrMarkdown, originalParent) {
|
|
1048
1213
|
if (!content.hasChildNodes() || content.textContent?.trim() === "") {
|
|
1049
1214
|
return;
|
|
1050
1215
|
}
|
|
1051
|
-
if (this.
|
|
1216
|
+
if (this.toolInvocationCount === 1 && this.hookCount === 0 && originalParent) {
|
|
1217
|
+
const toolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? toolInvocationOrMarkdown : undefined;
|
|
1052
1218
|
this.singleItemInfo = {
|
|
1053
1219
|
element: content,
|
|
1054
1220
|
originalParent,
|
|
1055
|
-
originalNextSibling: this.domNode
|
|
1221
|
+
originalNextSibling: this.domNode,
|
|
1222
|
+
toolInvocation
|
|
1056
1223
|
};
|
|
1057
1224
|
} else {
|
|
1058
1225
|
this.singleItemInfo = undefined;
|
|
@@ -1060,19 +1227,27 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1060
1227
|
const itemWrapper = $(".chat-thinking-tool-wrapper");
|
|
1061
1228
|
const isMarkdownEdit = toolInvocationOrMarkdown?.kind === "markdownContent";
|
|
1062
1229
|
const isTerminalTool = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") && toolInvocationOrMarkdown.toolSpecificData?.kind === "terminal";
|
|
1230
|
+
const toolInvocationIcon = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? toolInvocationOrMarkdown.icon : undefined;
|
|
1063
1231
|
let icon;
|
|
1064
1232
|
if (isMarkdownEdit) {
|
|
1065
1233
|
icon = Codicon.pencil;
|
|
1066
1234
|
} else if (isTerminalTool) {
|
|
1067
1235
|
const terminalData = toolInvocationOrMarkdown.toolSpecificData;
|
|
1068
1236
|
const exitCode = terminalData?.terminalCommandState?.exitCode;
|
|
1069
|
-
|
|
1237
|
+
const isSandboxWrapped = terminalData?.commandLine?.isSandboxWrapped;
|
|
1238
|
+
if (exitCode !== undefined && exitCode !== 0) {
|
|
1239
|
+
icon = Codicon.error;
|
|
1240
|
+
} else if (isSandboxWrapped) {
|
|
1241
|
+
icon = Codicon.terminalSecure;
|
|
1242
|
+
} else {
|
|
1243
|
+
icon = toolInvocationIcon ?? Codicon.terminal;
|
|
1244
|
+
}
|
|
1070
1245
|
} else if (content.classList.contains("chat-hook-outcome-blocked")) {
|
|
1071
1246
|
icon = Codicon.error;
|
|
1072
1247
|
} else if (content.classList.contains("chat-hook-outcome-warning")) {
|
|
1073
1248
|
icon = Codicon.warning;
|
|
1074
1249
|
} else {
|
|
1075
|
-
icon = toolInvocationId ? getToolInvocationIcon(toolInvocationId) : Codicon.tools;
|
|
1250
|
+
icon = toolInvocationId ? getToolInvocationIcon(toolInvocationId, toolInvocationIcon) : Codicon.tools;
|
|
1076
1251
|
}
|
|
1077
1252
|
const iconElement = createThinkingIcon(icon);
|
|
1078
1253
|
itemWrapper.appendChild(iconElement);
|
|
@@ -1080,6 +1255,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1080
1255
|
const isToolInvocation = toolInvocationOrMarkdown && (toolInvocationOrMarkdown.kind === "toolInvocation" || toolInvocationOrMarkdown.kind === "toolInvocationSerialized");
|
|
1081
1256
|
if (isToolInvocation && toolInvocationOrMarkdown.toolCallId) {
|
|
1082
1257
|
this.toolWrappersByCallId.set(toolInvocationOrMarkdown.toolCallId, itemWrapper);
|
|
1258
|
+
this.toolIconsByCallId.set(toolInvocationOrMarkdown.toolCallId, iconElement);
|
|
1083
1259
|
}
|
|
1084
1260
|
this.appendToWrapper(itemWrapper);
|
|
1085
1261
|
if (this.fixedScrollingMode && this.scrollableElement) {
|
|
@@ -1112,7 +1288,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1112
1288
|
if (result.disposable) {
|
|
1113
1289
|
const toolCallId = item.toolInvocationOrMarkdown && (item.toolInvocationOrMarkdown.kind === "toolInvocation" || item.toolInvocationOrMarkdown.kind === "toolInvocationSerialized") ? item.toolInvocationOrMarkdown.toolCallId : undefined;
|
|
1114
1290
|
if (toolCallId) {
|
|
1115
|
-
this.
|
|
1291
|
+
this.ownedToolParts.set(toolCallId, result.disposable);
|
|
1116
1292
|
} else {
|
|
1117
1293
|
this._register(result.disposable);
|
|
1118
1294
|
}
|
|
@@ -1161,15 +1337,12 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1161
1337
|
}
|
|
1162
1338
|
this.titleShimmerSpan = undefined;
|
|
1163
1339
|
this.titleDetailContainer = undefined;
|
|
1164
|
-
|
|
1165
|
-
this.titleDetailRendered.dispose();
|
|
1166
|
-
this.titleDetailRendered = undefined;
|
|
1167
|
-
}
|
|
1340
|
+
this._titleDetailRendered.clear();
|
|
1168
1341
|
this.currentTitle = title;
|
|
1169
1342
|
return;
|
|
1170
1343
|
}
|
|
1171
1344
|
this.lastExtractedTitle = title;
|
|
1172
|
-
const thinkingLabel =
|
|
1345
|
+
const thinkingLabel = ( localize(6805, "{0}: {1}", this.defaultTitle, title));
|
|
1173
1346
|
this.currentTitle = thinkingLabel;
|
|
1174
1347
|
if (!this._collapseButton) {
|
|
1175
1348
|
return;
|
|
@@ -1180,11 +1353,8 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1180
1353
|
this.titleShimmerSpan = $("span.chat-thinking-title-shimmer");
|
|
1181
1354
|
labelElement.appendChild(this.titleShimmerSpan);
|
|
1182
1355
|
}
|
|
1183
|
-
this.titleShimmerSpan.textContent = "
|
|
1184
|
-
|
|
1185
|
-
this.titleDetailRendered.dispose();
|
|
1186
|
-
this.titleDetailRendered = undefined;
|
|
1187
|
-
}
|
|
1356
|
+
this.titleShimmerSpan.textContent = ( localize(6806, "{0}: ", this.defaultTitle));
|
|
1357
|
+
this._titleDetailRendered.clear();
|
|
1188
1358
|
const result = this.chatContentMarkdownRenderer.render(( new MarkdownString(title)));
|
|
1189
1359
|
result.element.classList.add("collapsible-title-content", "chat-thinking-title-detail");
|
|
1190
1360
|
renderFileWidgets(
|
|
@@ -1193,7 +1363,7 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1193
1363
|
this.chatMarkdownAnchorService,
|
|
1194
1364
|
this._store
|
|
1195
1365
|
);
|
|
1196
|
-
this.
|
|
1366
|
+
this._titleDetailRendered.value = result;
|
|
1197
1367
|
if (this.titleDetailContainer) {
|
|
1198
1368
|
this.titleDetailContainer.replaceWith(result.element);
|
|
1199
1369
|
} else {
|
|
@@ -1204,6 +1374,9 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1204
1374
|
this._collapseButton.element.ariaExpanded = String(this.isExpanded());
|
|
1205
1375
|
}
|
|
1206
1376
|
hasSameContent(other, _followingContent, _element) {
|
|
1377
|
+
if (_element.isComplete) {
|
|
1378
|
+
return true;
|
|
1379
|
+
}
|
|
1207
1380
|
if (other.kind === "toolInvocation" || other.kind === "toolInvocationSerialized" || other.kind === "markdownContent" || other.kind === "hook") {
|
|
1208
1381
|
return true;
|
|
1209
1382
|
}
|
|
@@ -1214,14 +1387,6 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1214
1387
|
}
|
|
1215
1388
|
dispose() {
|
|
1216
1389
|
this.isActive = false;
|
|
1217
|
-
if (this.markdownResult) {
|
|
1218
|
-
this.markdownResult.dispose();
|
|
1219
|
-
this.markdownResult = undefined;
|
|
1220
|
-
}
|
|
1221
|
-
if (this.titleDetailRendered) {
|
|
1222
|
-
this.titleDetailRendered.dispose();
|
|
1223
|
-
this.titleDetailRendered = undefined;
|
|
1224
|
-
}
|
|
1225
1390
|
if (this.workingSpinnerElement) {
|
|
1226
1391
|
this.workingSpinnerElement.remove();
|
|
1227
1392
|
this.workingSpinnerElement = undefined;
|
|
@@ -1233,6 +1398,6 @@ ${this.hookCount > 0 ? `EXAMPLES WITH BLOCKED CONTENT (from hooks):
|
|
|
1233
1398
|
super.dispose();
|
|
1234
1399
|
}
|
|
1235
1400
|
};
|
|
1236
|
-
ChatThinkingContentPart = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, IConfigurationService)), ( __param(6, IChatMarkdownAnchorService)), ( __param(7, ILanguageModelsService)), ( __param(8, IHoverService))], ChatThinkingContentPart));
|
|
1401
|
+
ChatThinkingContentPart = ChatThinkingContentPart_1 = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, IConfigurationService)), ( __param(6, IChatMarkdownAnchorService)), ( __param(7, ILanguageModelsService)), ( __param(8, IHoverService))], ChatThinkingContentPart));
|
|
1237
1402
|
|
|
1238
|
-
export { ChatThinkingContentPart, createThinkingIcon, getToolInvocationIcon };
|
|
1403
|
+
export { ChatThinkingContentPart, buildPhrasePool, createThinkingIcon, getToolInvocationIcon };
|