@codingame/monaco-vscode-katex-common 28.4.0 → 29.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +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
|
@@ -31,13 +31,13 @@ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/even
|
|
|
31
31
|
import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
|
|
32
32
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
33
33
|
import { AgentSessionHoverWidget } from './agentSessionHoverWidget.js';
|
|
34
|
-
import { AgentSessionProviders
|
|
35
|
-
import { AgentSessionsGrouping } from './agentSessionsFilter.js';
|
|
34
|
+
import { AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
35
|
+
import { AgentSessionsGrouping, AgentSessionsSorting } from './agentSessionsFilter.js';
|
|
36
36
|
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
37
37
|
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
38
38
|
import { defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
39
39
|
import { BugIndicatingError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
40
|
-
import {
|
|
40
|
+
import { ChatSessionStatus, isSessionInProgressStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
41
41
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
42
42
|
|
|
43
43
|
var AgentSessionRenderer_1, AgentSessionSectionRenderer_1;
|
|
@@ -65,6 +65,7 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
65
65
|
constructor(
|
|
66
66
|
options,
|
|
67
67
|
_approvalModel,
|
|
68
|
+
_activeSessionResource,
|
|
68
69
|
markdownRendererService,
|
|
69
70
|
productService,
|
|
70
71
|
hoverService,
|
|
@@ -74,6 +75,7 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
74
75
|
super();
|
|
75
76
|
this.options = options;
|
|
76
77
|
this._approvalModel = _approvalModel;
|
|
78
|
+
this._activeSessionResource = _activeSessionResource;
|
|
77
79
|
this.markdownRendererService = markdownRendererService;
|
|
78
80
|
this.productService = productService;
|
|
79
81
|
this.hoverService = hoverService;
|
|
@@ -92,20 +94,19 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
92
94
|
h("div.agent-session-main-col", [h("div.agent-session-title-row", [
|
|
93
95
|
h("div.agent-session-title@title"),
|
|
94
96
|
h("div.agent-session-title-toolbar@titleToolbar")
|
|
95
|
-
]), h(
|
|
96
|
-
"div.agent-session-
|
|
97
|
-
|
|
97
|
+
]), h("div.agent-session-details-row", [
|
|
98
|
+
h("div.agent-session-badge@badge"),
|
|
99
|
+
h("span.agent-session-separator@separator"),
|
|
100
|
+
h("div.agent-session-diff-container@diffContainer", [
|
|
98
101
|
h("span.agent-session-diff-added@addedSpan"),
|
|
99
102
|
h("span.agent-session-diff-removed@removedSpan")
|
|
100
|
-
]),
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
])]
|
|
108
|
-
), h("div.agent-session-approval-row@approvalRow", [
|
|
103
|
+
]),
|
|
104
|
+
h("div.agent-session-description@description"),
|
|
105
|
+
h(
|
|
106
|
+
"div.agent-session-status@statusContainer",
|
|
107
|
+
[h("span.agent-session-status-time@statusTime")]
|
|
108
|
+
)
|
|
109
|
+
]), h("div.agent-session-approval-row@approvalRow", [
|
|
109
110
|
h("span.agent-session-approval-label@approvalLabel"),
|
|
110
111
|
h("div.agent-session-approval-button@approvalButtonContainer")
|
|
111
112
|
])])
|
|
@@ -131,14 +132,13 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
131
132
|
supportIcons: true
|
|
132
133
|
}))),
|
|
133
134
|
titleToolbar,
|
|
135
|
+
badge: elements.badge,
|
|
136
|
+
separator: elements.separator,
|
|
134
137
|
diffContainer: elements.diffContainer,
|
|
135
138
|
diffAddedSpan: elements.addedSpan,
|
|
136
139
|
diffRemovedSpan: elements.removedSpan,
|
|
137
|
-
badge: elements.badge,
|
|
138
|
-
separator: elements.separator,
|
|
139
140
|
description: elements.description,
|
|
140
141
|
statusContainer: elements.statusContainer,
|
|
141
|
-
statusProviderIcon: elements.statusProviderIcon,
|
|
142
142
|
statusTime: elements.statusTime,
|
|
143
143
|
approvalRow: elements.approvalRow,
|
|
144
144
|
approvalLabel: elements.approvalLabel,
|
|
@@ -155,15 +155,17 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
155
155
|
template.badge.textContent = "";
|
|
156
156
|
template.description.textContent = "";
|
|
157
157
|
template.element.classList.toggle("archived", session.element.isArchived());
|
|
158
|
-
template.icon.className = `agent-session-icon ${ThemeIcon.asClassName(this.getIcon(session.element))}`;
|
|
158
|
+
template.icon.className = `agent-session-icon ${ThemeIcon.asClassName(this.getIcon(session.element))}${session.element.status === ChatSessionStatus.NeedsInput ? " needs-input" : ""}`;
|
|
159
159
|
const markdownTitle = ( new MarkdownString(session.element.label));
|
|
160
160
|
template.title.setLabel(renderAsPlaintext(markdownTitle), undefined, {
|
|
161
161
|
matches: createMatches(session.filterData)
|
|
162
162
|
});
|
|
163
163
|
ChatContextKeys.isArchivedAgentSession.bindTo(template.contextKeyService).set(session.element.isArchived());
|
|
164
|
+
ChatContextKeys.isPinnedAgentSession.bindTo(template.contextKeyService).set(session.element.isPinned());
|
|
164
165
|
ChatContextKeys.isReadAgentSession.bindTo(template.contextKeyService).set(session.element.isRead());
|
|
165
166
|
ChatContextKeys.agentSessionType.bindTo(template.contextKeyService).set(session.element.providerType);
|
|
166
167
|
template.titleToolbar.context = session.element;
|
|
168
|
+
const hasBadge = this.renderBadge(session, template);
|
|
167
169
|
let hasDiff = false;
|
|
168
170
|
const {
|
|
169
171
|
changes: diff
|
|
@@ -173,7 +175,6 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
173
175
|
hasDiff = true;
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
|
-
template.diffContainer.classList.toggle("has-diff", hasDiff);
|
|
177
178
|
let hasAgentSessionChanges = false;
|
|
178
179
|
if (session.element.providerType === AgentSessionProviders.Background || session.element.providerType === AgentSessionProviders.Cloud) {
|
|
179
180
|
hasAgentSessionChanges = Array.isArray(diff) && diff.length > 0;
|
|
@@ -181,13 +182,18 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
181
182
|
hasAgentSessionChanges = hasDiff;
|
|
182
183
|
}
|
|
183
184
|
ChatContextKeys.hasAgentSessionChanges.bindTo(template.contextKeyService).set(hasAgentSessionChanges);
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
template.
|
|
190
|
-
|
|
185
|
+
const hasDescription = this.renderDescription(session, template);
|
|
186
|
+
const hasStatus = this.renderStatus(session, template);
|
|
187
|
+
const hideDetails = hasDescription && isSessionInProgressStatus(session.element.status);
|
|
188
|
+
template.badge.classList.toggle("has-badge", hasBadge && !hideDetails);
|
|
189
|
+
template.diffContainer.classList.toggle("has-diff", hasDiff && !hideDetails);
|
|
190
|
+
template.statusContainer.classList.toggle("hidden", hideDetails);
|
|
191
|
+
template.separator.classList.toggle("has-separator", !hideDetails && hasBadge && hasDiff);
|
|
192
|
+
template.description.classList.toggle("has-separator", hasDescription && !hideDetails && (hasBadge || hasDiff));
|
|
193
|
+
template.statusContainer.classList.toggle(
|
|
194
|
+
"has-separator",
|
|
195
|
+
!hideDetails && hasStatus && (hasBadge || hasDiff || hasDescription)
|
|
196
|
+
);
|
|
191
197
|
this.renderHover(session, template);
|
|
192
198
|
if (this._approvalModel) {
|
|
193
199
|
this.renderApprovalRow(session, template);
|
|
@@ -195,10 +201,38 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
195
201
|
}
|
|
196
202
|
renderBadge(session, template) {
|
|
197
203
|
const badge = session.element.badge;
|
|
198
|
-
if (badge) {
|
|
199
|
-
|
|
204
|
+
if (!badge) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
if (this.options.isGroupedByRepository?.() && !session.element.isArchived()) {
|
|
208
|
+
const raw = typeof badge === "string" ? badge : badge.value;
|
|
209
|
+
const match = raw.match(/^\$\((?:repo|folder|worktree)\)\s*(.+)/);
|
|
210
|
+
if (match) {
|
|
211
|
+
const badgeName = match[1].trim();
|
|
212
|
+
const repoName = getRepositoryName(session.element);
|
|
213
|
+
if (badgeName === repoName) {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
const normalisedBadge = this.stripCodicons(badge);
|
|
219
|
+
const badgeValue = typeof normalisedBadge === "string" ? normalisedBadge : normalisedBadge.value;
|
|
220
|
+
if (!badgeValue) {
|
|
221
|
+
return false;
|
|
200
222
|
}
|
|
201
|
-
|
|
223
|
+
this.renderMarkdownOrText(normalisedBadge, template.badge, template.elementDisposable);
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
226
|
+
stripCodicons(content) {
|
|
227
|
+
const raw = typeof content === "string" ? content : content.value;
|
|
228
|
+
const stripped = raw.replace(/\$\([a-z0-9\-]+\)\s*/gi, "").trim();
|
|
229
|
+
if (typeof content === "string") {
|
|
230
|
+
return stripped;
|
|
231
|
+
}
|
|
232
|
+
return MarkdownString.lift({
|
|
233
|
+
...content,
|
|
234
|
+
value: stripped
|
|
235
|
+
});
|
|
202
236
|
}
|
|
203
237
|
renderMarkdownOrText(content, container, disposables) {
|
|
204
238
|
if (typeof content === "string") {
|
|
@@ -222,6 +256,9 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
222
256
|
if (!diff) {
|
|
223
257
|
return false;
|
|
224
258
|
}
|
|
259
|
+
if (diff.insertions === 0 && diff.deletions === 0) {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
225
262
|
if (diff.insertions >= 0 ) {
|
|
226
263
|
template.diffAddedSpan.textContent = `+${diff.insertions}`;
|
|
227
264
|
}
|
|
@@ -235,7 +272,7 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
235
272
|
return Codicon.sessionInProgress;
|
|
236
273
|
}
|
|
237
274
|
if (session.status === ChatSessionStatus.NeedsInput) {
|
|
238
|
-
return Codicon.
|
|
275
|
+
return Codicon.circleFilled;
|
|
239
276
|
}
|
|
240
277
|
if (session.status === ChatSessionStatus.Failed) {
|
|
241
278
|
return Codicon.error;
|
|
@@ -243,34 +280,34 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
243
280
|
if (!session.isRead() && !session.isArchived()) {
|
|
244
281
|
return Codicon.circleFilled;
|
|
245
282
|
}
|
|
246
|
-
|
|
283
|
+
if (session.providerType === AgentSessionProviders.Local) {
|
|
284
|
+
return Codicon.circleSmallFilled;
|
|
285
|
+
}
|
|
286
|
+
return session.icon;
|
|
247
287
|
}
|
|
248
288
|
renderDescription(session, template) {
|
|
249
289
|
const description = session.element.description;
|
|
250
290
|
if (description) {
|
|
251
291
|
this.renderMarkdownOrText(description, template.description, template.elementDisposable);
|
|
252
|
-
return;
|
|
292
|
+
return true;
|
|
253
293
|
}
|
|
254
294
|
if (session.element.status === ChatSessionStatus.InProgress) {
|
|
255
|
-
template.description.textContent = ( localize(
|
|
295
|
+
template.description.textContent = ( localize(5171, "Working..."));
|
|
296
|
+
return true;
|
|
256
297
|
} else if (session.element.status === ChatSessionStatus.NeedsInput) {
|
|
257
|
-
template.description.textContent = ( localize(
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
false,
|
|
263
|
-
true
|
|
264
|
-
);
|
|
265
|
-
template.description.textContent = session.element.status === ChatSessionStatus.Failed ? ( localize(5128, "Failed after {0}", duration)) : ( localize(5129, "Completed in {0}", duration));
|
|
266
|
-
} else {
|
|
267
|
-
template.description.textContent = session.element.status === ChatSessionStatus.Failed ? ( localize(5130, "Failed")) : ( localize(5131, "Completed"));
|
|
298
|
+
template.description.textContent = ( localize(5172, "Input needed."));
|
|
299
|
+
return true;
|
|
300
|
+
} else if (session.element.status === ChatSessionStatus.Failed) {
|
|
301
|
+
template.description.textContent = ( localize(5173, "Failed"));
|
|
302
|
+
return true;
|
|
268
303
|
}
|
|
304
|
+
template.description.textContent = "";
|
|
305
|
+
return false;
|
|
269
306
|
}
|
|
270
307
|
toDuration(startTime, endTime, useFullTimeWords, disallowNow) {
|
|
271
308
|
const elapsed = Math.max(Math.round((endTime - startTime) / 1000) * 1000, 1000 );
|
|
272
309
|
if (!disallowNow && elapsed < 60000) {
|
|
273
|
-
return localize(
|
|
310
|
+
return localize(5174, "now");
|
|
274
311
|
}
|
|
275
312
|
return getDurationString(elapsed, useFullTimeWords);
|
|
276
313
|
}
|
|
@@ -281,32 +318,23 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
281
318
|
timeLabel = this.toDuration(session.timing.lastRequestStarted, Date.now(), false, false);
|
|
282
319
|
}
|
|
283
320
|
if (!timeLabel) {
|
|
284
|
-
const date =
|
|
321
|
+
const date = this.options.isSortedByUpdated?.() ? session.timing.lastRequestEnded ?? session.timing.created : session.timing.created;
|
|
285
322
|
const seconds = Math.round((( new Date()).getTime() - date) / 1000);
|
|
286
323
|
if (seconds < 60) {
|
|
287
|
-
timeLabel = ( localize(
|
|
324
|
+
timeLabel = ( localize(5174, "now"));
|
|
288
325
|
} else {
|
|
289
|
-
timeLabel = sessionDateFromNow(date);
|
|
326
|
+
timeLabel = sessionDateFromNow(date, true);
|
|
290
327
|
}
|
|
291
328
|
}
|
|
292
329
|
return timeLabel;
|
|
293
330
|
};
|
|
294
|
-
const isLocal = session.element.providerType === AgentSessionProviders.Local;
|
|
295
|
-
if (isLocal) {
|
|
296
|
-
template.statusProviderIcon.className = "";
|
|
297
|
-
} else if (this.options.showIsolationIcon && session.element.providerType === AgentSessionProviders.Background) {
|
|
298
|
-
const hasWorktree = typeof session.element.metadata?.worktreePath === "string";
|
|
299
|
-
const isolationIcon = hasWorktree ? Codicon.worktree : Codicon.folder;
|
|
300
|
-
template.statusProviderIcon.className = `agent-session-status-provider-icon ${ThemeIcon.asClassName(isolationIcon)}`;
|
|
301
|
-
} else {
|
|
302
|
-
template.statusProviderIcon.className = `agent-session-status-provider-icon ${ThemeIcon.asClassName(session.element.icon)}`;
|
|
303
|
-
}
|
|
304
331
|
template.statusTime.textContent = getTimeLabel(session.element);
|
|
305
332
|
const timer = template.elementDisposable.add(( new IntervalTimer()));
|
|
306
333
|
timer.cancelAndSet(
|
|
307
334
|
() => template.statusTime.textContent = getTimeLabel(session.element),
|
|
308
335
|
session.element.status === ChatSessionStatus.InProgress ? 1000 : 60 * 1000
|
|
309
336
|
);
|
|
337
|
+
return true;
|
|
310
338
|
}
|
|
311
339
|
renderHover(session, template) {
|
|
312
340
|
if (this.options.disableHover) {
|
|
@@ -374,11 +402,13 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
374
402
|
}
|
|
375
403
|
}));
|
|
376
404
|
template.approvalButtonContainer.textContent = "";
|
|
405
|
+
const isActive = this._activeSessionResource.read(reader)?.toString() === ( session.element.resource.toString());
|
|
377
406
|
const button = buttonStore.add(( new Button(template.approvalButtonContainer, {
|
|
378
|
-
title: ( localize(
|
|
407
|
+
title: ( localize(5175, "Allow once")),
|
|
408
|
+
secondary: isActive,
|
|
379
409
|
...defaultButtonStyles
|
|
380
410
|
})));
|
|
381
|
-
button.label = ( localize(
|
|
411
|
+
button.label = ( localize(5176, "Allow"));
|
|
382
412
|
buttonStore.add(button.onDidClick(() => info.confirm()));
|
|
383
413
|
}
|
|
384
414
|
if (wasVisible !== visible) {
|
|
@@ -397,21 +427,21 @@ let AgentSessionRenderer = class AgentSessionRenderer extends Disposable {
|
|
|
397
427
|
templateData.disposables.dispose();
|
|
398
428
|
}
|
|
399
429
|
};
|
|
400
|
-
AgentSessionRenderer = AgentSessionRenderer_1 = ( __decorate([( __param(
|
|
430
|
+
AgentSessionRenderer = AgentSessionRenderer_1 = ( __decorate([( __param(3, IMarkdownRendererService)), ( __param(4, IProductService)), ( __param(5, IHoverService)), ( __param(6, IInstantiationService)), ( __param(7, IContextKeyService))], AgentSessionRenderer));
|
|
401
431
|
function toStatusLabel(status) {
|
|
402
432
|
let statusLabel;
|
|
403
433
|
switch (status) {
|
|
404
434
|
case ChatSessionStatus.NeedsInput:
|
|
405
|
-
statusLabel = ( localize(
|
|
435
|
+
statusLabel = ( localize(5177, "Needs Input"));
|
|
406
436
|
break;
|
|
407
437
|
case ChatSessionStatus.InProgress:
|
|
408
|
-
statusLabel = ( localize(
|
|
438
|
+
statusLabel = ( localize(5178, "In Progress"));
|
|
409
439
|
break;
|
|
410
440
|
case ChatSessionStatus.Failed:
|
|
411
|
-
statusLabel = ( localize(
|
|
441
|
+
statusLabel = ( localize(5179, "Failed"));
|
|
412
442
|
break;
|
|
413
443
|
default:
|
|
414
|
-
statusLabel = ( localize(
|
|
444
|
+
statusLabel = ( localize(5180, "Completed"));
|
|
415
445
|
}
|
|
416
446
|
return statusLabel;
|
|
417
447
|
}
|
|
@@ -431,6 +461,7 @@ let AgentSessionSectionRenderer = class AgentSessionSectionRenderer {
|
|
|
431
461
|
const disposables = ( new DisposableStore());
|
|
432
462
|
const elements = h("div.agent-session-section@container", [
|
|
433
463
|
h("span.agent-session-section-label@label"),
|
|
464
|
+
h("span.agent-session-section-count@count"),
|
|
434
465
|
h("div.agent-session-section-toolbar@toolbar")
|
|
435
466
|
]);
|
|
436
467
|
const contextKeyService = disposables.add(this.contextKeyService.createScoped(elements.container));
|
|
@@ -449,6 +480,7 @@ let AgentSessionSectionRenderer = class AgentSessionSectionRenderer {
|
|
|
449
480
|
return {
|
|
450
481
|
container: elements.container,
|
|
451
482
|
label: elements.label,
|
|
483
|
+
count: elements.count,
|
|
452
484
|
toolbar,
|
|
453
485
|
contextKeyService,
|
|
454
486
|
disposables
|
|
@@ -456,6 +488,7 @@ let AgentSessionSectionRenderer = class AgentSessionSectionRenderer {
|
|
|
456
488
|
}
|
|
457
489
|
renderElement(element, index, template, details) {
|
|
458
490
|
template.label.textContent = element.element.label;
|
|
491
|
+
template.count.textContent = String(element.element.sessions.length);
|
|
459
492
|
ChatContextKeys.agentSessionSection.bindTo(template.contextKeyService).set(element.element.section);
|
|
460
493
|
template.toolbar.context = element.element;
|
|
461
494
|
}
|
|
@@ -507,14 +540,19 @@ class AgentSessionsAccessibilityProvider {
|
|
|
507
540
|
return "listitem";
|
|
508
541
|
}
|
|
509
542
|
getWidgetAriaLabel() {
|
|
510
|
-
return localize(
|
|
543
|
+
return localize(5181, "Agent Sessions");
|
|
511
544
|
}
|
|
512
545
|
getAriaLabel(element) {
|
|
513
546
|
if (isAgentSessionSection(element)) {
|
|
514
|
-
return localize(
|
|
547
|
+
return localize(
|
|
548
|
+
5182,
|
|
549
|
+
"{0} sessions section, {1} sessions",
|
|
550
|
+
element.label,
|
|
551
|
+
element.sessions.length
|
|
552
|
+
);
|
|
515
553
|
}
|
|
516
554
|
return localize(
|
|
517
|
-
|
|
555
|
+
5183,
|
|
518
556
|
"{0} session {1} ({2}), created {3}",
|
|
519
557
|
element.providerLabel,
|
|
520
558
|
element.label,
|
|
@@ -570,12 +608,20 @@ class AgentSessionsDataSource extends Disposable {
|
|
|
570
608
|
}
|
|
571
609
|
}
|
|
572
610
|
groupSessionsIntoSections(sessions) {
|
|
573
|
-
const
|
|
574
|
-
|
|
611
|
+
const isCapped = this.filter?.groupResults?.() === AgentSessionsGrouping.Capped;
|
|
612
|
+
const sorter = this.sorter;
|
|
613
|
+
const sortedSessions = sorter instanceof AgentSessionsSorter ? sessions.sort((a, b) => sorter.compare(
|
|
614
|
+
a,
|
|
615
|
+
b,
|
|
616
|
+
isCapped
|
|
617
|
+
)) : sessions.sort(sorter.compare.bind(sorter));
|
|
618
|
+
if (isCapped) {
|
|
575
619
|
if (this.filter?.getExcludes().read) {
|
|
576
620
|
return sortedSessions;
|
|
577
621
|
}
|
|
578
622
|
return this.groupSessionsCapped(sortedSessions);
|
|
623
|
+
} else if (this.filter?.groupResults?.() === AgentSessionsGrouping.Repository) {
|
|
624
|
+
return this.groupSessionsByRepository(sortedSessions);
|
|
579
625
|
} else {
|
|
580
626
|
return this.groupSessionsByDate(sortedSessions);
|
|
581
627
|
}
|
|
@@ -584,12 +630,14 @@ class AgentSessionsDataSource extends Disposable {
|
|
|
584
630
|
const result = [];
|
|
585
631
|
const firstArchivedIndex = sortedSessions.findIndex(session => session.isArchived());
|
|
586
632
|
const nonArchivedCount = firstArchivedIndex === -1 ? sortedSessions.length : firstArchivedIndex;
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
);
|
|
591
|
-
const
|
|
592
|
-
|
|
633
|
+
const nonArchivedSessions = sortedSessions.slice(0, nonArchivedCount);
|
|
634
|
+
const archivedSessions = sortedSessions.slice(nonArchivedCount);
|
|
635
|
+
const pinnedSessions = nonArchivedSessions.filter(session => session.isPinned());
|
|
636
|
+
const unpinnedSessions = nonArchivedSessions.filter(session => !session.isPinned());
|
|
637
|
+
const topUnpinned = unpinnedSessions.slice(0, AgentSessionsDataSource.CAPPED_SESSIONS_LIMIT);
|
|
638
|
+
const remainingUnpinned = unpinnedSessions.slice(AgentSessionsDataSource.CAPPED_SESSIONS_LIMIT);
|
|
639
|
+
result.push(...pinnedSessions, ...topUnpinned);
|
|
640
|
+
const othersSessions = [...remainingUnpinned, ...archivedSessions];
|
|
593
641
|
if (othersSessions.length > 0) {
|
|
594
642
|
result.push({
|
|
595
643
|
section: AgentSessionSection.More,
|
|
@@ -601,7 +649,8 @@ class AgentSessionsDataSource extends Disposable {
|
|
|
601
649
|
}
|
|
602
650
|
groupSessionsByDate(sortedSessions) {
|
|
603
651
|
const result = [];
|
|
604
|
-
const
|
|
652
|
+
const sortBy = this.filter?.sortResults?.();
|
|
653
|
+
const groupedSessions = groupAgentSessionsByDate(sortedSessions, sortBy);
|
|
605
654
|
for (const {
|
|
606
655
|
sessions,
|
|
607
656
|
section,
|
|
@@ -618,22 +667,200 @@ class AgentSessionsDataSource extends Disposable {
|
|
|
618
667
|
}
|
|
619
668
|
return result;
|
|
620
669
|
}
|
|
670
|
+
groupSessionsByRepository(sortedSessions) {
|
|
671
|
+
const repoMap = ( new Map());
|
|
672
|
+
const pinnedSessions = [];
|
|
673
|
+
const archivedSessions = [];
|
|
674
|
+
const otherSessions = [];
|
|
675
|
+
for (const session of sortedSessions) {
|
|
676
|
+
if (session.isArchived()) {
|
|
677
|
+
archivedSessions.push(session);
|
|
678
|
+
continue;
|
|
679
|
+
}
|
|
680
|
+
if (session.isPinned()) {
|
|
681
|
+
pinnedSessions.push(session);
|
|
682
|
+
continue;
|
|
683
|
+
}
|
|
684
|
+
const repoName = getRepositoryName(session);
|
|
685
|
+
if (repoName) {
|
|
686
|
+
let group = repoMap.get(repoName);
|
|
687
|
+
if (!group) {
|
|
688
|
+
group = {
|
|
689
|
+
label: repoName,
|
|
690
|
+
sessions: []
|
|
691
|
+
};
|
|
692
|
+
repoMap.set(repoName, group);
|
|
693
|
+
}
|
|
694
|
+
group.sessions.push(session);
|
|
695
|
+
} else {
|
|
696
|
+
otherSessions.push(session);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
const result = [];
|
|
700
|
+
if (pinnedSessions.length > 0) {
|
|
701
|
+
result.push({
|
|
702
|
+
section: AgentSessionSection.Pinned,
|
|
703
|
+
label: AgentSessionSectionLabels[AgentSessionSection.Pinned],
|
|
704
|
+
sessions: pinnedSessions
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
for (const [, {
|
|
708
|
+
label,
|
|
709
|
+
sessions
|
|
710
|
+
}] of repoMap) {
|
|
711
|
+
result.push({
|
|
712
|
+
section: AgentSessionSection.Repository,
|
|
713
|
+
label,
|
|
714
|
+
sessions
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
if (otherSessions.length > 0) {
|
|
718
|
+
result.push({
|
|
719
|
+
section: AgentSessionSection.Repository,
|
|
720
|
+
label: AgentSessionSectionLabels[AgentSessionSection.Repository],
|
|
721
|
+
sessions: otherSessions
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
if (archivedSessions.length > 0) {
|
|
725
|
+
result.push({
|
|
726
|
+
section: AgentSessionSection.Archived,
|
|
727
|
+
label: AgentSessionSectionLabels[AgentSessionSection.Archived],
|
|
728
|
+
sessions: archivedSessions
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
return result;
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
function getRepositoryName(session) {
|
|
735
|
+
const metadata = session.metadata;
|
|
736
|
+
if (metadata) {
|
|
737
|
+
const remoteAgentHost = metadata.remoteAgentHost;
|
|
738
|
+
if (remoteAgentHost) {
|
|
739
|
+
const workingDir = metadata.workingDirectoryPath;
|
|
740
|
+
if (workingDir) {
|
|
741
|
+
const folderName = extractRepoNameFromPath(workingDir);
|
|
742
|
+
if (folderName) {
|
|
743
|
+
return `${folderName} [${remoteAgentHost}]`;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return remoteAgentHost;
|
|
747
|
+
}
|
|
748
|
+
const owner = metadata.owner;
|
|
749
|
+
const name = metadata.name;
|
|
750
|
+
if (owner && name) {
|
|
751
|
+
return name;
|
|
752
|
+
}
|
|
753
|
+
const nwo = metadata.repositoryNwo;
|
|
754
|
+
if (nwo && nwo.includes("/")) {
|
|
755
|
+
return nwo.split("/").pop();
|
|
756
|
+
}
|
|
757
|
+
const repository = metadata.repository;
|
|
758
|
+
if (repository) {
|
|
759
|
+
const repoName = parseRepositoryName(repository);
|
|
760
|
+
if (repoName) {
|
|
761
|
+
return repoName;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
const repositoryUrl = metadata.repositoryUrl;
|
|
765
|
+
if (repositoryUrl) {
|
|
766
|
+
const repoName = parseRepositoryName(repositoryUrl);
|
|
767
|
+
if (repoName) {
|
|
768
|
+
return repoName;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
const repositoryPath = metadata.repositoryPath;
|
|
772
|
+
if (repositoryPath) {
|
|
773
|
+
const repoName = extractRepoNameFromPath(repositoryPath);
|
|
774
|
+
if (repoName) {
|
|
775
|
+
return repoName;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
const worktreePath = metadata.worktreePath;
|
|
779
|
+
if (worktreePath) {
|
|
780
|
+
const repoName = extractRepoNameFromPath(worktreePath);
|
|
781
|
+
if (repoName) {
|
|
782
|
+
return repoName;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
const workingDirectoryPath = metadata.workingDirectoryPath;
|
|
786
|
+
if (workingDirectoryPath) {
|
|
787
|
+
const repoName = extractRepoNameFromPath(workingDirectoryPath);
|
|
788
|
+
if (repoName) {
|
|
789
|
+
return repoName;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
const badge = session.badge;
|
|
794
|
+
if (badge) {
|
|
795
|
+
const raw = typeof badge === "string" ? badge : badge.value;
|
|
796
|
+
const badgeMatch = raw.match(/\$\((?:repo|folder|worktree)\)\s*(.+)/);
|
|
797
|
+
if (badgeMatch) {
|
|
798
|
+
return badgeMatch[1].trim();
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
return undefined;
|
|
802
|
+
}
|
|
803
|
+
function parseRepositoryName(value) {
|
|
804
|
+
if (value.includes("/") && !value.includes("://") && !value.startsWith("git@")) {
|
|
805
|
+
let repoSegment = value.split("/").filter(Boolean).pop();
|
|
806
|
+
if (repoSegment?.endsWith(".git")) {
|
|
807
|
+
repoSegment = repoSegment.slice(0, -4);
|
|
808
|
+
}
|
|
809
|
+
return repoSegment || undefined;
|
|
810
|
+
}
|
|
811
|
+
try {
|
|
812
|
+
const url = ( new URL(value));
|
|
813
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
814
|
+
if (parts.length >= 2) {
|
|
815
|
+
let repoSegment = parts[1];
|
|
816
|
+
if (repoSegment.endsWith(".git")) {
|
|
817
|
+
repoSegment = repoSegment.slice(0, -4);
|
|
818
|
+
}
|
|
819
|
+
return repoSegment || undefined;
|
|
820
|
+
}
|
|
821
|
+
} catch {}
|
|
822
|
+
if (value.startsWith("git@")) {
|
|
823
|
+
const colonIndex = value.indexOf(":");
|
|
824
|
+
if (colonIndex !== -1 && colonIndex < value.length - 1) {
|
|
825
|
+
const pathPart = value.substring(colonIndex + 1);
|
|
826
|
+
let repoSegment = pathPart.split("/").filter(Boolean).pop();
|
|
827
|
+
if (repoSegment?.endsWith(".git")) {
|
|
828
|
+
repoSegment = repoSegment.slice(0, -4);
|
|
829
|
+
}
|
|
830
|
+
return repoSegment || undefined;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return undefined;
|
|
834
|
+
}
|
|
835
|
+
function extractRepoNameFromPath(dirPath) {
|
|
836
|
+
const segments = dirPath.split(/[/\\]/).filter(Boolean);
|
|
837
|
+
if (segments.length < 2) {
|
|
838
|
+
return segments[0];
|
|
839
|
+
}
|
|
840
|
+
const parent = segments[segments.length - 2];
|
|
841
|
+
if (parent.endsWith(".worktrees")) {
|
|
842
|
+
return parent.slice(0, -".worktrees".length) || undefined;
|
|
843
|
+
}
|
|
844
|
+
return segments[segments.length - 1];
|
|
621
845
|
}
|
|
622
846
|
const AgentSessionSectionLabels = {
|
|
623
|
-
[AgentSessionSection.
|
|
624
|
-
[AgentSessionSection.
|
|
625
|
-
[AgentSessionSection.
|
|
626
|
-
[AgentSessionSection.
|
|
627
|
-
[AgentSessionSection.
|
|
628
|
-
[AgentSessionSection.
|
|
847
|
+
[AgentSessionSection.Pinned]: ( localize(5184, "Pinned")),
|
|
848
|
+
[AgentSessionSection.Today]: ( localize(5185, "Today")),
|
|
849
|
+
[AgentSessionSection.Yesterday]: ( localize(5186, "Yesterday")),
|
|
850
|
+
[AgentSessionSection.Week]: ( localize(5187, "Last 7 days")),
|
|
851
|
+
[AgentSessionSection.Older]: ( localize(5188, "Older")),
|
|
852
|
+
[AgentSessionSection.Archived]: ( localize(5189, "Archived")),
|
|
853
|
+
[AgentSessionSection.More]: ( localize(5190, "More")),
|
|
854
|
+
[AgentSessionSection.Repository]: ( localize(5191, "Other"))
|
|
629
855
|
};
|
|
630
856
|
const DAY_THRESHOLD = 24 * 60 * 60 * 1000;
|
|
631
857
|
const WEEK_THRESHOLD = 7 * DAY_THRESHOLD;
|
|
632
|
-
function groupAgentSessionsByDate(sessions) {
|
|
858
|
+
function groupAgentSessionsByDate(sessions, sortBy) {
|
|
633
859
|
const now = Date.now();
|
|
634
860
|
const startOfToday = ( new Date(now)).setHours(0, 0, 0, 0);
|
|
635
861
|
const startOfYesterday = startOfToday - DAY_THRESHOLD;
|
|
636
862
|
const weekThreshold = now - WEEK_THRESHOLD;
|
|
863
|
+
const pinnedSessions = [];
|
|
637
864
|
const todaySessions = [];
|
|
638
865
|
const yesterdaySessions = [];
|
|
639
866
|
const weekSessions = [];
|
|
@@ -642,8 +869,10 @@ function groupAgentSessionsByDate(sessions) {
|
|
|
642
869
|
for (const session of sessions) {
|
|
643
870
|
if (session.isArchived()) {
|
|
644
871
|
archivedSessions.push(session);
|
|
872
|
+
} else if (session.isPinned()) {
|
|
873
|
+
pinnedSessions.push(session);
|
|
645
874
|
} else {
|
|
646
|
-
const sessionTime =
|
|
875
|
+
const sessionTime = sortBy === AgentSessionsSorting.Updated ? session.timing.lastRequestEnded ?? session.timing.created : session.timing.created;
|
|
647
876
|
if (sessionTime >= startOfToday) {
|
|
648
877
|
todaySessions.push(session);
|
|
649
878
|
} else if (sessionTime >= startOfYesterday) {
|
|
@@ -655,7 +884,11 @@ function groupAgentSessionsByDate(sessions) {
|
|
|
655
884
|
}
|
|
656
885
|
}
|
|
657
886
|
}
|
|
658
|
-
return ( new Map([[AgentSessionSection.
|
|
887
|
+
return ( new Map([[AgentSessionSection.Pinned, {
|
|
888
|
+
section: AgentSessionSection.Pinned,
|
|
889
|
+
label: AgentSessionSectionLabels[AgentSessionSection.Pinned],
|
|
890
|
+
sessions: pinnedSessions
|
|
891
|
+
}], [AgentSessionSection.Today, {
|
|
659
892
|
section: AgentSessionSection.Today,
|
|
660
893
|
label: AgentSessionSectionLabels[AgentSessionSection.Today],
|
|
661
894
|
sessions: todaySessions
|
|
@@ -677,23 +910,23 @@ function groupAgentSessionsByDate(sessions) {
|
|
|
677
910
|
sessions: archivedSessions
|
|
678
911
|
}]]));
|
|
679
912
|
}
|
|
680
|
-
function sessionDateFromNow(sessionTime) {
|
|
913
|
+
function sessionDateFromNow(sessionTime, appendAgoLabel) {
|
|
681
914
|
const now = Date.now();
|
|
682
915
|
const startOfToday = ( new Date(now)).setHours(0, 0, 0, 0);
|
|
683
916
|
const startOfYesterday = startOfToday - DAY_THRESHOLD;
|
|
684
917
|
const startOfTwoDaysAgo = startOfYesterday - DAY_THRESHOLD;
|
|
685
918
|
if (sessionTime < startOfToday && sessionTime >= startOfYesterday) {
|
|
686
|
-
return localize(
|
|
919
|
+
return appendAgoLabel ? ( localize(5192, "1 day ago")) : ( localize(5193, "1 day"));
|
|
687
920
|
}
|
|
688
921
|
if (sessionTime < startOfYesterday && sessionTime >= startOfTwoDaysAgo) {
|
|
689
|
-
return localize(
|
|
922
|
+
return appendAgoLabel ? ( localize(5194, "2 days ago")) : ( localize(5195, "2 days"));
|
|
690
923
|
}
|
|
691
|
-
return fromNow(sessionTime,
|
|
924
|
+
return fromNow(sessionTime, appendAgoLabel);
|
|
692
925
|
}
|
|
693
926
|
class AgentSessionsIdentityProvider {
|
|
694
927
|
getId(element) {
|
|
695
928
|
if (isAgentSessionSection(element)) {
|
|
696
|
-
return `section-${element.section}`;
|
|
929
|
+
return `section-${element.section}-${element.label}`;
|
|
697
930
|
}
|
|
698
931
|
if (isAgentSession(element)) {
|
|
699
932
|
return ( element.resource.toString());
|
|
@@ -713,17 +946,19 @@ class AgentSessionsCompressionDelegate {
|
|
|
713
946
|
}
|
|
714
947
|
}
|
|
715
948
|
class AgentSessionsSorter {
|
|
716
|
-
constructor(
|
|
717
|
-
this.
|
|
949
|
+
constructor(getSortBy) {
|
|
950
|
+
this.getSortBy = getSortBy ?? (() => AgentSessionsSorting.Created);
|
|
718
951
|
}
|
|
719
|
-
compare(sessionA, sessionB) {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
952
|
+
compare(sessionA, sessionB, prioritizeActiveSessions = false) {
|
|
953
|
+
if (prioritizeActiveSessions) {
|
|
954
|
+
const aNeedsInput = sessionA.status === ChatSessionStatus.NeedsInput;
|
|
955
|
+
const bNeedsInput = sessionB.status === ChatSessionStatus.NeedsInput;
|
|
956
|
+
if (aNeedsInput && !bNeedsInput) {
|
|
957
|
+
return -1;
|
|
958
|
+
}
|
|
959
|
+
if (!aNeedsInput && bNeedsInput) {
|
|
960
|
+
return 1;
|
|
961
|
+
}
|
|
727
962
|
}
|
|
728
963
|
const aArchived = sessionA.isArchived();
|
|
729
964
|
const bArchived = sessionB.isArchived();
|
|
@@ -733,12 +968,17 @@ class AgentSessionsSorter {
|
|
|
733
968
|
if (aArchived && !bArchived) {
|
|
734
969
|
return 1;
|
|
735
970
|
}
|
|
736
|
-
const
|
|
737
|
-
|
|
738
|
-
|
|
971
|
+
const aPinned = !aArchived && sessionA.isPinned();
|
|
972
|
+
const bPinned = !bArchived && sessionB.isPinned();
|
|
973
|
+
if (aPinned && !bPinned) {
|
|
974
|
+
return -1;
|
|
975
|
+
}
|
|
976
|
+
if (!aPinned && bPinned) {
|
|
977
|
+
return 1;
|
|
739
978
|
}
|
|
740
|
-
const
|
|
741
|
-
const
|
|
979
|
+
const sortBy = this.getSortBy();
|
|
980
|
+
const timeA = prioritizeActiveSessions ? sessionA.timing.lastRequestStarted ?? sessionA.timing.created : sortBy === AgentSessionsSorting.Updated ? sessionA.timing.lastRequestEnded ?? sessionA.timing.created : sessionA.timing.created;
|
|
981
|
+
const timeB = prioritizeActiveSessions ? sessionB.timing.lastRequestStarted ?? sessionB.timing.created : sortBy === AgentSessionsSorting.Updated ? sessionB.timing.lastRequestEnded ?? sessionB.timing.created : sessionB.timing.created;
|
|
742
982
|
return timeB - timeA;
|
|
743
983
|
}
|
|
744
984
|
}
|
|
@@ -774,7 +1014,7 @@ let AgentSessionsDragAndDrop = class AgentSessionsDragAndDrop extends Disposable
|
|
|
774
1014
|
if (sessions.length === 1) {
|
|
775
1015
|
return sessions[0].label;
|
|
776
1016
|
}
|
|
777
|
-
return localize(
|
|
1017
|
+
return localize(5196, "{0} agent sessions", sessions.length);
|
|
778
1018
|
}
|
|
779
1019
|
onDragOver(data, targetElement, targetIndex, targetSector, originalEvent) {
|
|
780
1020
|
return false;
|
|
@@ -783,4 +1023,4 @@ let AgentSessionsDragAndDrop = class AgentSessionsDragAndDrop extends Disposable
|
|
|
783
1023
|
};
|
|
784
1024
|
AgentSessionsDragAndDrop = ( __decorate([( __param(0, IInstantiationService))], AgentSessionsDragAndDrop));
|
|
785
1025
|
|
|
786
|
-
export { AgentSessionRenderer, AgentSessionSectionLabels, AgentSessionSectionRenderer, AgentSessionsAccessibilityProvider, AgentSessionsCompressionDelegate, AgentSessionsDataSource, AgentSessionsDragAndDrop, AgentSessionsIdentityProvider, AgentSessionsKeyboardNavigationLabelProvider, AgentSessionsListDelegate, AgentSessionsSorter, groupAgentSessionsByDate, sessionDateFromNow, toStatusLabel };
|
|
1026
|
+
export { AgentSessionRenderer, AgentSessionSectionLabels, AgentSessionSectionRenderer, AgentSessionsAccessibilityProvider, AgentSessionsCompressionDelegate, AgentSessionsDataSource, AgentSessionsDragAndDrop, AgentSessionsIdentityProvider, AgentSessionsKeyboardNavigationLabelProvider, AgentSessionsListDelegate, AgentSessionsSorter, getRepositoryName, groupAgentSessionsByDate, sessionDateFromNow, toStatusLabel };
|