@codingame/monaco-vscode-katex-common 32.0.2 → 33.0.7
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/platform/agentHost/common/claudeSessionConfigKeys.d.ts +30 -0
- package/vscode/src/vs/platform/agentHost/common/claudeSessionConfigKeys.js +8 -0
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.d.ts +32 -0
- package/vscode/src/vs/platform/agentHost/common/sessionConfigKeys.js +13 -0
- 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 +56 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +502 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +153 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +52 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +23 -20
- 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.d.ts +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +40 -13
- 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.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +217 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +44 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -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 +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +12 -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 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +8 -13
- 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/chatTerminalToolProgressPart.css +16 -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.js +2 -2
- 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 +24 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +72 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +7 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/media/toolRiskBadge.css +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +25 -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 +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +41 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +31 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +89 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +203 -107
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +18 -18
- 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 +32 -81
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- 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/inlineChat.css +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +4 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +29 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +27 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +17 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +150 -69
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +9 -14
|
@@ -31,9 +31,7 @@ let ChatQueryTitlePart = class ChatQueryTitlePart extends Disposable {
|
|
|
31
31
|
}
|
|
32
32
|
set title(value) {
|
|
33
33
|
this._title = value;
|
|
34
|
-
const next = this.
|
|
35
|
-
asyncRenderCallback: () => this._onDidChangeHeight.fire()
|
|
36
|
-
});
|
|
34
|
+
const next = this.renderTitle(value);
|
|
37
35
|
const previousEl = this._renderedTitle.value?.element;
|
|
38
36
|
if (previousEl?.parentElement) {
|
|
39
37
|
previousEl.replaceWith(next.element);
|
|
@@ -42,24 +40,30 @@ let ChatQueryTitlePart = class ChatQueryTitlePart extends Disposable {
|
|
|
42
40
|
}
|
|
43
41
|
this._renderedTitle.value = next;
|
|
44
42
|
}
|
|
45
|
-
constructor(
|
|
43
|
+
constructor(
|
|
44
|
+
element,
|
|
45
|
+
_title,
|
|
46
|
+
subtitle,
|
|
47
|
+
_renderer,
|
|
48
|
+
_instantiationService,
|
|
49
|
+
_chatMarkdownAnchorService
|
|
50
|
+
) {
|
|
46
51
|
super();
|
|
47
52
|
this.element = element;
|
|
48
53
|
this._title = _title;
|
|
49
54
|
this._renderer = _renderer;
|
|
55
|
+
this._instantiationService = _instantiationService;
|
|
56
|
+
this._chatMarkdownAnchorService = _chatMarkdownAnchorService;
|
|
50
57
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
51
58
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
52
59
|
this._renderedTitle = this._register(( new MutableDisposable()));
|
|
60
|
+
this._fileWidgetStore = this._register(( new DisposableStore()));
|
|
53
61
|
element.classList.add("chat-query-title-part");
|
|
54
|
-
this._renderedTitle.value =
|
|
55
|
-
asyncRenderCallback: () => this._onDidChangeHeight.fire()
|
|
56
|
-
});
|
|
62
|
+
this._renderedTitle.value = this.renderTitle(_title);
|
|
57
63
|
element.append(this._renderedTitle.value.element);
|
|
58
64
|
if (subtitle) {
|
|
59
65
|
const str = this.toMdString(subtitle);
|
|
60
|
-
const renderedTitle = this._register(_renderer.render(str,
|
|
61
|
-
asyncRenderCallback: () => this._onDidChangeHeight.fire()
|
|
62
|
-
}));
|
|
66
|
+
const renderedTitle = this._register(_renderer.render(str, this.getRenderOptions()));
|
|
63
67
|
const wrapper = createElement("small");
|
|
64
68
|
wrapper.appendChild(renderedTitle.element);
|
|
65
69
|
element.append(wrapper);
|
|
@@ -77,8 +81,31 @@ let ChatQueryTitlePart = class ChatQueryTitlePart extends Disposable {
|
|
|
77
81
|
}));
|
|
78
82
|
}
|
|
79
83
|
}
|
|
84
|
+
setOptions(options) {
|
|
85
|
+
this.options = options;
|
|
86
|
+
this.title = this._title;
|
|
87
|
+
}
|
|
88
|
+
renderTitle(value) {
|
|
89
|
+
const renderedTitle = this._renderer.render(this.toMdString(value), this.getRenderOptions());
|
|
90
|
+
this._fileWidgetStore.clear();
|
|
91
|
+
if (this.options?.renderFileWidgets) {
|
|
92
|
+
renderFileWidgets(
|
|
93
|
+
renderedTitle.element,
|
|
94
|
+
this._instantiationService,
|
|
95
|
+
this._chatMarkdownAnchorService,
|
|
96
|
+
this._fileWidgetStore
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
return renderedTitle;
|
|
100
|
+
}
|
|
101
|
+
getRenderOptions() {
|
|
102
|
+
return {
|
|
103
|
+
...this.options?.markdownRenderOptions,
|
|
104
|
+
asyncRenderCallback: () => this._onDidChangeHeight.fire()
|
|
105
|
+
};
|
|
106
|
+
}
|
|
80
107
|
};
|
|
81
|
-
ChatQueryTitlePart = ( __decorate([( __param(3, IMarkdownRendererService))], ChatQueryTitlePart));
|
|
108
|
+
ChatQueryTitlePart = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IInstantiationService)), ( __param(5, IChatMarkdownAnchorService))], ChatQueryTitlePart));
|
|
82
109
|
let BaseSimpleChatConfirmationWidget = class BaseSimpleChatConfirmationWidget extends Disposable {
|
|
83
110
|
get onDidClick() {
|
|
84
111
|
return this._onDidClick.event;
|
|
@@ -480,12 +507,12 @@ function configureAccessibilityContainer(container, title, message, footerBanner
|
|
|
480
507
|
const messageAsString = typeof message === "string" ? message : message && "value" in message ? message.value : message && "textContent" in message ? message.textContent : "";
|
|
481
508
|
const bannerAsString = footerBanner?.textContent?.trim() ?? "";
|
|
482
509
|
container.setAttribute("aria-label", bannerAsString ? ( localize(
|
|
483
|
-
|
|
510
|
+
7140,
|
|
484
511
|
"Chat Confirmation Dialog {0} {1} {2}",
|
|
485
512
|
titleAsString,
|
|
486
513
|
messageAsString,
|
|
487
514
|
bannerAsString
|
|
488
|
-
)) : ( localize(
|
|
515
|
+
)) : ( localize(7141, "Chat Confirmation Dialog {0} {1}", titleAsString, messageAsString)));
|
|
489
516
|
container.classList.add("chat-confirmation-widget-container");
|
|
490
517
|
}
|
|
491
518
|
|
|
@@ -24,13 +24,13 @@ let ChatDisabledClaudeHooksContentPart = class ChatDisabledClaudeHooksContentPar
|
|
|
24
24
|
const icon = $(".chat-disabled-claude-hooks-icon");
|
|
25
25
|
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.info));
|
|
26
26
|
const enableLink = createMarkdownCommandLink({
|
|
27
|
-
text: ( localize(
|
|
27
|
+
text: ( localize(7142, "Enable")),
|
|
28
28
|
id: "workbench.action.openSettings",
|
|
29
29
|
arguments: [PromptsConfig.USE_CLAUDE_HOOKS],
|
|
30
|
-
tooltip: ( localize(
|
|
30
|
+
tooltip: ( localize(7143, "Open settings to enable Claude Code hooks"))
|
|
31
31
|
});
|
|
32
32
|
const message = ( localize(
|
|
33
|
-
|
|
33
|
+
7144,
|
|
34
34
|
"Claude Code hooks are available for this workspace. {0}",
|
|
35
35
|
enableLink
|
|
36
36
|
));
|
|
@@ -30,7 +30,7 @@ let ChatExtensionsContentPart = class ChatExtensionsContentPart extends Disposab
|
|
|
30
30
|
append(
|
|
31
31
|
loadingElement,
|
|
32
32
|
$(ThemeIcon.asCSSSelector(ThemeIcon.modify(Codicon.loading, "spin"))),
|
|
33
|
-
$("span.loading-message", undefined, ( localize(
|
|
33
|
+
$("span.loading-message", undefined, ( localize(7145, "Loading extensions...")))
|
|
34
34
|
);
|
|
35
35
|
const extensionsList = append(this.domNode, $(".extensions-list"));
|
|
36
36
|
const list = this._register(
|
package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js
CHANGED
|
@@ -20,7 +20,7 @@ let ChatHookContentPart = class ChatHookContentPart extends ChatCollapsibleConte
|
|
|
20
20
|
const isStopped = !!hookPart.stopReason;
|
|
21
21
|
const isWarning = !!hookPart.systemMessage;
|
|
22
22
|
const toolName = hookPart.toolDisplayName;
|
|
23
|
-
const title = isStopped ? (toolName ? ( localize(
|
|
23
|
+
const title = isStopped ? (toolName ? ( localize(7146, "Blocked {0} - {1} hook", toolName, hookTypeLabel)) : ( localize(7147, "Blocked by {0} hook", hookTypeLabel))) : (toolName ? ( localize(7148, "Warning for {0} - {1} hook", toolName, hookTypeLabel)) : ( localize(7149, "Warning from {0} hook", hookTypeLabel)));
|
|
24
24
|
super(title, context, undefined, hoverService, configurationService);
|
|
25
25
|
this.hookPart = hookPart;
|
|
26
26
|
this.icon = isStopped ? Codicon.error : isWarning ? Codicon.warning : Codicon.check;
|
|
@@ -246,10 +246,10 @@ let InlineAnchorWidget = class InlineAnchorWidget extends Disposable {
|
|
|
246
246
|
);
|
|
247
247
|
if (location.range) {
|
|
248
248
|
if (location.range.startLineNumber === location.range.endLineNumber) {
|
|
249
|
-
element.setAttribute("aria-label", ( localize(
|
|
249
|
+
element.setAttribute("aria-label", ( localize(7150, "{0} line {1}", filePathLabel, location.range.startLineNumber)));
|
|
250
250
|
} else {
|
|
251
251
|
element.setAttribute("aria-label", ( localize(
|
|
252
|
-
|
|
252
|
+
7151,
|
|
253
253
|
"{0} lines {1} to {2}",
|
|
254
254
|
filePathLabel,
|
|
255
255
|
location.range.startLineNumber,
|
|
@@ -319,7 +319,7 @@ registerAction2(class AddFileToChatAction extends Action2 {
|
|
|
319
319
|
constructor() {
|
|
320
320
|
super({
|
|
321
321
|
id: AddFileToChatAction.id,
|
|
322
|
-
title: ( localize2(
|
|
322
|
+
title: ( localize2(7152, "Add File to Chat")),
|
|
323
323
|
menu: [{
|
|
324
324
|
id: MenuId.ChatInlineResourceAnchorContext,
|
|
325
325
|
group: "chat",
|
|
@@ -343,7 +343,7 @@ registerAction2(class CopyResourceAction extends Action2 {
|
|
|
343
343
|
constructor() {
|
|
344
344
|
super({
|
|
345
345
|
id: CopyResourceAction.id,
|
|
346
|
-
title: ( localize2(
|
|
346
|
+
title: ( localize2(7153, "Copy")),
|
|
347
347
|
f1: false,
|
|
348
348
|
precondition: chatAttachmentResourceContextKey,
|
|
349
349
|
keybinding: {
|
|
@@ -370,7 +370,7 @@ registerAction2(class OpenToSideResourceAction extends Action2 {
|
|
|
370
370
|
constructor() {
|
|
371
371
|
super({
|
|
372
372
|
id: OpenToSideResourceAction.id,
|
|
373
|
-
title: ( localize2(
|
|
373
|
+
title: ( localize2(7154, "Open to the Side")),
|
|
374
374
|
f1: false,
|
|
375
375
|
precondition: chatAttachmentResourceContextKey,
|
|
376
376
|
keybinding: {
|
|
@@ -436,8 +436,8 @@ registerAction2(class GoToDefinitionAction extends Action2 {
|
|
|
436
436
|
super({
|
|
437
437
|
id: GoToDefinitionAction.id,
|
|
438
438
|
title: {
|
|
439
|
-
...( localize2(
|
|
440
|
-
mnemonicTitle: ( localize(
|
|
439
|
+
...( localize2(7155, "Go to Definition")),
|
|
440
|
+
mnemonicTitle: ( localize(7156, "Go to &&Definition"))
|
|
441
441
|
},
|
|
442
442
|
menu: ( [
|
|
443
443
|
MenuId.ChatInlineSymbolAnchorContext,
|
|
@@ -494,8 +494,8 @@ registerAction2(class GoToTypeDefinitionsAction extends Action2 {
|
|
|
494
494
|
super({
|
|
495
495
|
id: GoToTypeDefinitionsAction.id,
|
|
496
496
|
title: {
|
|
497
|
-
...( localize2(
|
|
498
|
-
mnemonicTitle: ( localize(
|
|
497
|
+
...( localize2(7157, "Go to Type Definitions")),
|
|
498
|
+
mnemonicTitle: ( localize(7158, "Go to &&Type Definitions"))
|
|
499
499
|
},
|
|
500
500
|
menu: ( [
|
|
501
501
|
MenuId.ChatInlineSymbolAnchorContext,
|
|
@@ -520,8 +520,8 @@ registerAction2(class GoToImplementations extends Action2 {
|
|
|
520
520
|
super({
|
|
521
521
|
id: GoToImplementations.id,
|
|
522
522
|
title: {
|
|
523
|
-
...( localize2(
|
|
524
|
-
mnemonicTitle: ( localize(
|
|
523
|
+
...( localize2(7159, "Go to Implementations")),
|
|
524
|
+
mnemonicTitle: ( localize(7160, "Go to &&Implementations"))
|
|
525
525
|
},
|
|
526
526
|
menu: ( [
|
|
527
527
|
MenuId.ChatInlineSymbolAnchorContext,
|
|
@@ -546,8 +546,8 @@ registerAction2(class GoToReferencesAction extends Action2 {
|
|
|
546
546
|
super({
|
|
547
547
|
id: GoToReferencesAction.id,
|
|
548
548
|
title: {
|
|
549
|
-
...( localize2(
|
|
550
|
-
mnemonicTitle: ( localize(
|
|
549
|
+
...( localize2(7161, "Go to References")),
|
|
550
|
+
mnemonicTitle: ( localize(7162, "Go to &&References"))
|
|
551
551
|
},
|
|
552
552
|
menu: ( [
|
|
553
553
|
MenuId.ChatInlineSymbolAnchorContext,
|
|
@@ -19,6 +19,7 @@ import { IChatProgressRenderableResponseContent } from "@codingame/monaco-vscode
|
|
|
19
19
|
import { IChatMarkdownContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
20
20
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
21
21
|
import { IChatCodeBlockInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
22
|
+
import { IChatOutputRendererService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.service";
|
|
22
23
|
import { ICodeBlockRenderOptions } from "./codeBlockPart.js";
|
|
23
24
|
import { EditorPool } from "./chatContentCodePools.js";
|
|
24
25
|
import { IChatContentPart, IChatContentPartRenderContext } from "./chatContentParts.js";
|
|
@@ -40,6 +41,7 @@ export declare class ChatMarkdownContentPart extends Disposable implements IChat
|
|
|
40
41
|
private readonly rendererOptions;
|
|
41
42
|
private readonly instantiationService;
|
|
42
43
|
private readonly aiEditTelemetryService;
|
|
44
|
+
private readonly chatOutputRendererService;
|
|
43
45
|
private static ID_POOL;
|
|
44
46
|
readonly codeblocksPartId: string;
|
|
45
47
|
readonly domNode: HTMLElement;
|
|
@@ -57,9 +59,10 @@ export declare class ChatMarkdownContentPart extends Disposable implements IChat
|
|
|
57
59
|
private readonly mathLayoutParticipants;
|
|
58
60
|
/** Incremental rendering morpher — only created when the experiment is enabled. */
|
|
59
61
|
private _incrementalMorpher;
|
|
60
|
-
constructor(markdown: IChatMarkdownContent, context: IChatContentPartRenderContext, editorPool: EditorPool, fillInIncompleteTokens: boolean | undefined, codeBlockStartIndex: number | undefined, renderer: IMarkdownRenderer, markdownRenderOptions: MarkdownRenderOptions | undefined, currentWidth: number, rendererOptions: IChatMarkdownContentPartOptions, contextKeyService: IContextKeyService, configurationService: IConfigurationService, instantiationService: IInstantiationService, aiEditTelemetryService: IAiEditTelemetryService);
|
|
62
|
+
constructor(markdown: IChatMarkdownContent, context: IChatContentPartRenderContext, editorPool: EditorPool, fillInIncompleteTokens: boolean | undefined, codeBlockStartIndex: number | undefined, renderer: IMarkdownRenderer, markdownRenderOptions: MarkdownRenderOptions | undefined, currentWidth: number, rendererOptions: IChatMarkdownContentPartOptions, contextKeyService: IContextKeyService, configurationService: IConfigurationService, instantiationService: IInstantiationService, aiEditTelemetryService: IAiEditTelemetryService, chatOutputRendererService: IChatOutputRendererService);
|
|
61
63
|
dispose(): void;
|
|
62
64
|
private renderCodeBlockPill;
|
|
65
|
+
private renderChatOutputCodeBlock;
|
|
63
66
|
private fireAggregatedDiff;
|
|
64
67
|
private renderCodeBlock;
|
|
65
68
|
hasSameContent(other: IChatProgressRenderableResponseContent): boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
-
import { $ as $$1, clearNode, getWindow, DisposableResizeObserver, isHTMLElement, addDisposableListener, EventType, EventHelper } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { $ as $$1, clearNode, getWindow, DisposableResizeObserver, isHTMLElement, append, addDisposableListener, EventType, EventHelper } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
5
5
|
import { allowedMarkdownHtmlAttributes } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
6
6
|
import { StandardMouseEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/mouseEvent';
|
|
7
7
|
import { status } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
@@ -11,7 +11,9 @@ import { DomScrollableElement } from '@codingame/monaco-vscode-api/vscode/vs/bas
|
|
|
11
11
|
import { wrapTablesWithScrollable } from './chatMarkdownTableScrolling.js';
|
|
12
12
|
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
13
13
|
import { findLast } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arraysFind';
|
|
14
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
14
15
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
16
|
+
import { isCancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
15
17
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
16
18
|
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
17
19
|
import { Disposable, MutableDisposable, DisposableStore, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
@@ -48,18 +50,21 @@ import { extractCodeblockUrisFromText, extractVulnerabilitiesFromText } from '..
|
|
|
48
50
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
49
51
|
import { isResponseVM, isRequestVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatViewModel';
|
|
50
52
|
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
53
|
+
import { IChatOutputRendererService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.service';
|
|
51
54
|
import { allowedChatMarkdownHtmlTags } from '../chatContentMarkdownRenderer.js';
|
|
52
55
|
import { parseUnifiedDiff, MarkdownDiffBlockPart } from './chatDiffBlockPart.js';
|
|
53
56
|
import { ChatMarkdownDecorationsRenderer } from './chatMarkdownDecorationsRenderer.js';
|
|
54
57
|
import { CodeBlockPart } from './codeBlockPart.js';
|
|
55
58
|
import * as chatCodeBlockPill from './media/chatCodeBlockPill.css';
|
|
56
59
|
import { ChatExtensionsContentPart } from './chatExtensionsContentPart.js';
|
|
60
|
+
import { ChatProgressSubPart } from './chatProgressContentPart.js';
|
|
57
61
|
import { IncrementalDOMMorpher } from './chatIncrementalRendering/chatIncrementalRendering.js';
|
|
62
|
+
import { IChatOutputPartStateCache } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service';
|
|
58
63
|
import * as chatMarkdownPart from './media/chatMarkdownPart.css';
|
|
59
64
|
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
60
65
|
import { autorun, autorunSelfDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
61
66
|
|
|
62
|
-
var ChatMarkdownContentPart_1;
|
|
67
|
+
var ChatMarkdownContentPart_1, ChatOutputCodeBlockPart_1;
|
|
63
68
|
registerCss(chatCodeBlockPill);
|
|
64
69
|
registerCss(chatMarkdownPart);
|
|
65
70
|
const $ = $$1;
|
|
@@ -86,7 +91,8 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
86
91
|
contextKeyService,
|
|
87
92
|
configurationService,
|
|
88
93
|
instantiationService,
|
|
89
|
-
aiEditTelemetryService
|
|
94
|
+
aiEditTelemetryService,
|
|
95
|
+
chatOutputRendererService
|
|
90
96
|
) {
|
|
91
97
|
super();
|
|
92
98
|
this.markdown = markdown;
|
|
@@ -94,6 +100,7 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
94
100
|
this.rendererOptions = rendererOptions;
|
|
95
101
|
this.instantiationService = instantiationService;
|
|
96
102
|
this.aiEditTelemetryService = aiEditTelemetryService;
|
|
103
|
+
this.chatOutputRendererService = chatOutputRendererService;
|
|
97
104
|
this.codeblocksPartId = String(++ChatMarkdownContentPart_1.ID_POOL);
|
|
98
105
|
this._onDidChangeHeight = this._register(( new Emitter()));
|
|
99
106
|
this.onDidChangeHeight = this._onDidChangeHeight.event;
|
|
@@ -135,10 +142,19 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
135
142
|
if (this._store.isDisposed) {
|
|
136
143
|
return;
|
|
137
144
|
}
|
|
145
|
+
const previousRenderStore = renderStore.clearAndLeak();
|
|
146
|
+
const reusableOutputCodeBlockRefs = ( new Map());
|
|
147
|
+
for (const ref of this.allRefs) {
|
|
148
|
+
if (ref.object instanceof ChatOutputCodeBlockPart) {
|
|
149
|
+
const outputRef = ref;
|
|
150
|
+
previousRenderStore?.deleteAndLeak(outputRef);
|
|
151
|
+
reusableOutputCodeBlockRefs.set(outputRef.object.reuseKey, outputRef);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
previousRenderStore?.dispose();
|
|
138
155
|
const store = ( new DisposableStore());
|
|
139
156
|
renderStore.value = store;
|
|
140
157
|
clearNode(this.domNode);
|
|
141
|
-
dispose(this.allRefs);
|
|
142
158
|
this.allRefs.length = 0;
|
|
143
159
|
this._codeblocks.length = 0;
|
|
144
160
|
this.mathLayoutParticipants.clear();
|
|
@@ -158,7 +174,8 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
158
174
|
fillInIncompleteTokens,
|
|
159
175
|
codeBlockRendererSync: (languageId, text, raw) => {
|
|
160
176
|
const isCodeBlockComplete = !isResponseVM(context.element) || context.element.isComplete || !raw || codeblockHasClosingBackticks(raw);
|
|
161
|
-
|
|
177
|
+
const hasChatOutputRenderer = !!languageId && this.chatOutputRendererService.hasCodeBlockRenderer(languageId);
|
|
178
|
+
if ((!text || (text.startsWith("<vscode_codeblock_uri") && !text.includes("\n"))) && !isCodeBlockComplete && !hasChatOutputRenderer) {
|
|
162
179
|
const hideEmptyCodeblock = $("div");
|
|
163
180
|
hideEmptyCodeblock.style.display = "none";
|
|
164
181
|
return hideEmptyCodeblock;
|
|
@@ -245,6 +262,29 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
245
262
|
editDeltaInfo: EditDeltaInfo.fromText(text)
|
|
246
263
|
};
|
|
247
264
|
if (element.isCompleteAddedRequest || !codemapperUri || !isEdit) {
|
|
265
|
+
if (hasChatOutputRenderer) {
|
|
266
|
+
const ref = this.renderChatOutputCodeBlock(
|
|
267
|
+
languageId,
|
|
268
|
+
codeBlockText,
|
|
269
|
+
globalIndex,
|
|
270
|
+
context,
|
|
271
|
+
isCodeBlockComplete,
|
|
272
|
+
reusableOutputCodeBlockRefs
|
|
273
|
+
);
|
|
274
|
+
this._codeblocks.push({
|
|
275
|
+
...baseCodeBlockInfo,
|
|
276
|
+
codemapperUri: codeBlockInfo.codemapperUri,
|
|
277
|
+
isStreamingEdit: false,
|
|
278
|
+
get uri() {
|
|
279
|
+
return undefined;
|
|
280
|
+
},
|
|
281
|
+
focus() {
|
|
282
|
+
ref.object.focus();
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
store.add(ref);
|
|
286
|
+
return ref.object.element;
|
|
287
|
+
}
|
|
248
288
|
const ref = this.renderCodeBlock(codeBlockInfo, currentWidth);
|
|
249
289
|
this._codeblocks.push({
|
|
250
290
|
...baseCodeBlockInfo,
|
|
@@ -325,6 +365,7 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
325
365
|
scrollable.scanDomNode();
|
|
326
366
|
}
|
|
327
367
|
store.add(wrapTablesWithScrollable(this.domNode, layoutParticipants));
|
|
368
|
+
dispose(( reusableOutputCodeBlockRefs.values()));
|
|
328
369
|
};
|
|
329
370
|
doRenderMarkdown();
|
|
330
371
|
this._incrementalMorpher?.seed(markdown.content.value, true);
|
|
@@ -357,6 +398,38 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
357
398
|
codeBlock.render(codemapperUri);
|
|
358
399
|
return ref;
|
|
359
400
|
}
|
|
401
|
+
renderChatOutputCodeBlock(
|
|
402
|
+
identifier,
|
|
403
|
+
text,
|
|
404
|
+
codeBlockIndex,
|
|
405
|
+
context,
|
|
406
|
+
isComplete,
|
|
407
|
+
reusableOutputCodeBlockRefs
|
|
408
|
+
) {
|
|
409
|
+
const reuseKey = ChatOutputCodeBlockPart.reuseKey(context.element.id, codeBlockIndex, identifier);
|
|
410
|
+
const reusableRef = reusableOutputCodeBlockRefs.get(reuseKey);
|
|
411
|
+
if (reusableRef?.object.hasSameContent(identifier, text, isComplete)) {
|
|
412
|
+
reusableOutputCodeBlockRefs.delete(reuseKey);
|
|
413
|
+
this.allRefs.push(reusableRef);
|
|
414
|
+
return reusableRef;
|
|
415
|
+
}
|
|
416
|
+
const codeBlock = this.instantiationService.createInstance(
|
|
417
|
+
ChatOutputCodeBlockPart,
|
|
418
|
+
identifier,
|
|
419
|
+
text,
|
|
420
|
+
codeBlockIndex,
|
|
421
|
+
context,
|
|
422
|
+
isComplete,
|
|
423
|
+
() => this._onDidChangeHeight.fire()
|
|
424
|
+
);
|
|
425
|
+
const ref = {
|
|
426
|
+
object: codeBlock,
|
|
427
|
+
isStale: () => false,
|
|
428
|
+
dispose: () => codeBlock.dispose()
|
|
429
|
+
};
|
|
430
|
+
this.allRefs.push(ref);
|
|
431
|
+
return ref;
|
|
432
|
+
}
|
|
360
433
|
fireAggregatedDiff() {
|
|
361
434
|
let totalAdded = 0;
|
|
362
435
|
let totalRemoved = 0;
|
|
@@ -414,6 +487,8 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
414
487
|
this.allRefs.forEach((ref, index) => {
|
|
415
488
|
if (ref.object instanceof CodeBlockPart) {
|
|
416
489
|
ref.object.layout(width);
|
|
490
|
+
} else if (ref.object instanceof ChatOutputCodeBlockPart) {
|
|
491
|
+
ref.object.layout(width);
|
|
417
492
|
} else if (ref.object instanceof MarkdownDiffBlockPart) {
|
|
418
493
|
ref.object.layout(width);
|
|
419
494
|
} else if (ref.object instanceof CollapsedCodeBlock) {
|
|
@@ -427,7 +502,7 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
427
502
|
}
|
|
428
503
|
onDidRemount() {
|
|
429
504
|
for (const ref of this.allRefs) {
|
|
430
|
-
if (ref.object instanceof CodeBlockPart) {
|
|
505
|
+
if (ref.object instanceof CodeBlockPart || ref.object instanceof ChatOutputCodeBlockPart) {
|
|
431
506
|
ref.object.onDidRemount();
|
|
432
507
|
}
|
|
433
508
|
}
|
|
@@ -436,7 +511,7 @@ let ChatMarkdownContentPart = class ChatMarkdownContentPart extends Disposable {
|
|
|
436
511
|
this._register(disposable);
|
|
437
512
|
}
|
|
438
513
|
};
|
|
439
|
-
ChatMarkdownContentPart = ChatMarkdownContentPart_1 = ( __decorate([( __param(9, IContextKeyService)), ( __param(10, IConfigurationService)), ( __param(11, IInstantiationService)), ( __param(12, IAiEditTelemetryService))], ChatMarkdownContentPart));
|
|
514
|
+
ChatMarkdownContentPart = ChatMarkdownContentPart_1 = ( __decorate([( __param(9, IContextKeyService)), ( __param(10, IConfigurationService)), ( __param(11, IInstantiationService)), ( __param(12, IAiEditTelemetryService)), ( __param(13, IChatOutputRendererService))], ChatMarkdownContentPart));
|
|
440
515
|
function equalsInlineReferences(a, b) {
|
|
441
516
|
if (a === b) {
|
|
442
517
|
return true;
|
|
@@ -490,6 +565,135 @@ function codeblockHasClosingBackticks(str) {
|
|
|
490
565
|
str = str.trim();
|
|
491
566
|
return !!str.match(/\n```+$/);
|
|
492
567
|
}
|
|
568
|
+
let ChatOutputCodeBlockPart = ChatOutputCodeBlockPart_1 = class ChatOutputCodeBlockPart extends Disposable {
|
|
569
|
+
static reuseKey(elementId, codeBlockIndex, identifier) {
|
|
570
|
+
return `${elementId}/${codeBlockIndex}/${identifier.toLowerCase()}`;
|
|
571
|
+
}
|
|
572
|
+
constructor(
|
|
573
|
+
identifier,
|
|
574
|
+
text,
|
|
575
|
+
codeBlockIndex,
|
|
576
|
+
context,
|
|
577
|
+
isComplete,
|
|
578
|
+
onDidChangeHeight,
|
|
579
|
+
instantiationService,
|
|
580
|
+
chatOutputRendererService,
|
|
581
|
+
stateCache
|
|
582
|
+
) {
|
|
583
|
+
super();
|
|
584
|
+
this.identifier = identifier;
|
|
585
|
+
this.text = text;
|
|
586
|
+
this.context = context;
|
|
587
|
+
this.isComplete = isComplete;
|
|
588
|
+
this.onDidChangeHeight = onDidChangeHeight;
|
|
589
|
+
this.instantiationService = instantiationService;
|
|
590
|
+
this.chatOutputRendererService = chatOutputRendererService;
|
|
591
|
+
this.stateCache = stateCache;
|
|
592
|
+
this._disposeCts = this._register(( new CancellationTokenSource()));
|
|
593
|
+
this._renderedOutputPart = this._register(( new MutableDisposable()));
|
|
594
|
+
this.reuseKey = ChatOutputCodeBlockPart_1.reuseKey(context.element.id, codeBlockIndex, identifier);
|
|
595
|
+
const title = ( localize(7163, "Rendered code block {0}", codeBlockIndex + 1));
|
|
596
|
+
this.element = $(".interactive-result-code-block.chat-output-code-block.tool-output-part");
|
|
597
|
+
this.element.tabIndex = -1;
|
|
598
|
+
this.element.ariaLabel = title;
|
|
599
|
+
const parent = $(".webview-output");
|
|
600
|
+
parent.style.maxHeight = "80vh";
|
|
601
|
+
parent.style.minHeight = "38px";
|
|
602
|
+
this.element.appendChild(parent);
|
|
603
|
+
const stateCacheKey = `codeBlock/${( context.element.sessionResource.toString())}/${context.element.id}/${codeBlockIndex}/${identifier.toLowerCase()}`;
|
|
604
|
+
const partState = this.stateCache.get(stateCacheKey) ?? {
|
|
605
|
+
height: 0
|
|
606
|
+
};
|
|
607
|
+
this.stateCache.set(stateCacheKey, partState);
|
|
608
|
+
if (partState.height) {
|
|
609
|
+
parent.style.height = `${partState.height}px`;
|
|
610
|
+
}
|
|
611
|
+
const progressMessage = $("span");
|
|
612
|
+
progressMessage.textContent = ( localize(7164, "Rendering code block..."));
|
|
613
|
+
const progressPart = this._register(this.instantiationService.createInstance(
|
|
614
|
+
ChatProgressSubPart,
|
|
615
|
+
progressMessage,
|
|
616
|
+
ThemeIcon.modify(Codicon.loading, "spin"),
|
|
617
|
+
undefined
|
|
618
|
+
));
|
|
619
|
+
parent.appendChild(progressPart.domNode);
|
|
620
|
+
if (!isComplete) {
|
|
621
|
+
this.onDidChangeHeight();
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
this.chatOutputRendererService.renderCodeBlock(identifier, ( new TextEncoder()).encode(text), parent, {
|
|
625
|
+
webviewState: partState.webviewState,
|
|
626
|
+
title,
|
|
627
|
+
chatSessionResource: this.context.element.sessionResource
|
|
628
|
+
}, this._disposeCts.token).then(renderedItem => {
|
|
629
|
+
if (this._disposeCts.token.isCancellationRequested) {
|
|
630
|
+
renderedItem.dispose();
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
this._renderedOutputPart.value = renderedItem;
|
|
634
|
+
progressPart.domNode.remove();
|
|
635
|
+
parent.style.minHeight = "";
|
|
636
|
+
this.onDidChangeHeight();
|
|
637
|
+
this._register(renderedItem.webview.onDidUpdateState(e => {
|
|
638
|
+
partState.webviewState = e;
|
|
639
|
+
}));
|
|
640
|
+
this._register(renderedItem.onDidChangeHeight(newHeight => {
|
|
641
|
+
partState.height = newHeight;
|
|
642
|
+
this.onDidChangeHeight();
|
|
643
|
+
}));
|
|
644
|
+
this._register(this.context.onDidChangeVisibility(visible => {
|
|
645
|
+
if (visible) {
|
|
646
|
+
renderedItem.reinitialize();
|
|
647
|
+
}
|
|
648
|
+
}));
|
|
649
|
+
}, error => {
|
|
650
|
+
if (isCancellationError(error)) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
console.error("Error rendering chat code block:", error);
|
|
654
|
+
progressPart.domNode.replaceWith(this.renderError(error));
|
|
655
|
+
parent.style.minHeight = "";
|
|
656
|
+
this.onDidChangeHeight();
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
hasSameContent(identifier, text, isComplete) {
|
|
660
|
+
return identifier.toLowerCase() === this.identifier.toLowerCase() && text === this.text && isComplete === this.isComplete;
|
|
661
|
+
}
|
|
662
|
+
dispose() {
|
|
663
|
+
this._disposeCts.dispose(true);
|
|
664
|
+
super.dispose();
|
|
665
|
+
}
|
|
666
|
+
layout(width) {
|
|
667
|
+
this.element.style.maxWidth = `${width}px`;
|
|
668
|
+
}
|
|
669
|
+
onDidRemount() {
|
|
670
|
+
this._renderedOutputPart.value?.reinitialize();
|
|
671
|
+
}
|
|
672
|
+
focus() {
|
|
673
|
+
const webview = this._renderedOutputPart.value?.webview;
|
|
674
|
+
if (webview) {
|
|
675
|
+
webview.focus();
|
|
676
|
+
} else {
|
|
677
|
+
this.element.focus();
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
renderError(error) {
|
|
681
|
+
const errorNode = $(".output-error");
|
|
682
|
+
const errorHeaderNode = $(".output-error-header");
|
|
683
|
+
append(errorNode, errorHeaderNode);
|
|
684
|
+
const iconElement = $("div");
|
|
685
|
+
iconElement.classList.add(...ThemeIcon.asClassNameArray(Codicon.error));
|
|
686
|
+
errorHeaderNode.append(iconElement);
|
|
687
|
+
const errorTitleNode = $(".output-error-title");
|
|
688
|
+
errorTitleNode.textContent = ( localize(7165, "Error rendering the code block"));
|
|
689
|
+
errorHeaderNode.append(errorTitleNode);
|
|
690
|
+
const errorMessageNode = $(".output-error-details");
|
|
691
|
+
errorMessageNode.textContent = error?.message || String(error);
|
|
692
|
+
errorNode.append(errorMessageNode);
|
|
693
|
+
return errorNode;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
ChatOutputCodeBlockPart = ChatOutputCodeBlockPart_1 = ( __decorate([( __param(6, IInstantiationService)), ( __param(7, IChatOutputRendererService)), ( __param(8, IChatOutputPartStateCache))], ChatOutputCodeBlockPart));
|
|
493
697
|
let CollapsedCodeBlock = class CollapsedCodeBlock extends Disposable {
|
|
494
698
|
get uri() {
|
|
495
699
|
return this._uri;
|
|
@@ -631,7 +835,7 @@ let CollapsedCodeBlock = class CollapsedCodeBlock extends Disposable {
|
|
|
631
835
|
statusIconEl.classList.add(...statusIconClasses);
|
|
632
836
|
const entry = editSession.readEntry(uri, r);
|
|
633
837
|
const rwRatio = Math.floor((entry?.rewriteRatio.read(r) || 0) * 100);
|
|
634
|
-
statusLabelEl.textContent = ( localize(
|
|
838
|
+
statusLabelEl.textContent = ( localize(7166, "Applying edits"));
|
|
635
839
|
const showAnimation = this.configurationService.getValue(ChatConfiguration.ShowCodeBlockProgressAnimation);
|
|
636
840
|
if (showAnimation) {
|
|
637
841
|
progressFill.style.width = `${rwRatio}%`;
|
|
@@ -640,13 +844,13 @@ let CollapsedCodeBlock = class CollapsedCodeBlock extends Disposable {
|
|
|
640
844
|
} else {
|
|
641
845
|
progressFill.style.width = "0%";
|
|
642
846
|
this.pillElement.classList.remove("progress-filling");
|
|
643
|
-
labelDetail.textContent = rwRatio === 0 || !rwRatio ? ( localize(
|
|
847
|
+
labelDetail.textContent = rwRatio === 0 || !rwRatio ? ( localize(7167, "Generating edits...")) : ( localize(7168, "({0}%)...", rwRatio));
|
|
644
848
|
}
|
|
645
849
|
} else {
|
|
646
850
|
const statusCodeicon = Codicon.check;
|
|
647
851
|
statusIconClasses = ThemeIcon.asClassNameArray(statusCodeicon);
|
|
648
852
|
statusIconEl.classList.add(...statusIconClasses);
|
|
649
|
-
statusLabelEl.textContent = ( localize(
|
|
853
|
+
statusLabelEl.textContent = ( localize(7169, "Edited"));
|
|
650
854
|
const fileKind = uri.path.endsWith("/") ? FileKind.FOLDER : FileKind.FILE;
|
|
651
855
|
pillIconClasses = getIconClasses(this.modelService, this.languageService, uri, fileKind);
|
|
652
856
|
iconEl.classList.add(...pillIconClasses);
|
|
@@ -667,10 +871,10 @@ let CollapsedCodeBlock = class CollapsedCodeBlock extends Disposable {
|
|
|
667
871
|
this._onDidChangeDiff.fire(changes);
|
|
668
872
|
labelAdded.textContent = `+${changes.added}`;
|
|
669
873
|
labelRemoved.textContent = `-${changes.removed}`;
|
|
670
|
-
const insertionsFragment = changes.added === 1 ? ( localize(
|
|
671
|
-
const deletionsFragment = changes.removed === 1 ? ( localize(
|
|
874
|
+
const insertionsFragment = changes.added === 1 ? ( localize(7170, "1 insertion")) : ( localize(7171, "{0} insertions", changes.added));
|
|
875
|
+
const deletionsFragment = changes.removed === 1 ? ( localize(7172, "1 deletion")) : ( localize(7173, "{0} deletions", changes.removed));
|
|
672
876
|
const summary = ( localize(
|
|
673
|
-
|
|
877
|
+
7174,
|
|
674
878
|
"Edited {0}, {1}, {2}",
|
|
675
879
|
iconText,
|
|
676
880
|
insertionsFragment,
|