@codingame/monaco-vscode-workbench-service-override 37.3.3 → 37.3.5
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 +10 -10
- package/session.js +11 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentCheckoutOperationMeta.d.ts +18 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentCheckoutOperationMeta.js +27 -0
- package/vscode/src/vs/sessions/browser/layoutActions.d.ts +1 -0
- package/vscode/src/vs/sessions/browser/layoutActions.js +146 -0
- package/vscode/src/vs/sessions/browser/parts/chatCompositeBar.js +6 -6
- package/vscode/src/vs/sessions/browser/parts/chatGroupView.js +5 -5
- package/vscode/src/vs/sessions/browser/parts/menubar.contribution.js +8 -8
- package/vscode/src/vs/sessions/browser/parts/sessionHeader.js +1 -1
- package/vscode/src/vs/sessions/browser/parts/sessionReadOnlyBanner.js +1 -1
- package/vscode/src/vs/sessions/browser/parts/sessionRemoteConnection.js +20 -20
- package/vscode/src/vs/sessions/browser/sessionsSetUpService.js +7 -7
- package/vscode/src/vs/sessions/browser/sessionsSignInDialog.js +4 -4
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.js +42 -42
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.js +11 -11
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.js +18 -18
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeViewViews.js +12 -12
- package/vscode/src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.js +149 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.js +12 -12
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquariumOverlay.js +11 -11
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fish.d.ts +1 -1
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fish.js +8 -8
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.js +68 -68
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.js +7 -7
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.js +4 -4
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.js +2 -2
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.js +38 -38
- package/vscode/src/vs/sessions/contrib/automations/browser/automations.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.js +1 -1
- package/vscode/src/vs/sessions/contrib/changes/browser/changes.contribution.js +6 -6
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.js +4 -4
- package/vscode/src/vs/sessions/contrib/changes/browser/changesViewActions.js +20 -20
- package/vscode/src/vs/sessions/contrib/changes/browser/changesetReviewActions.js +1 -1
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionSyncChanges.js +9 -9
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionsChangesAccessibilityHelp.js +17 -17
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.js +17 -17
- package/vscode/src/vs/sessions/contrib/chat/browser/taskCommand.d.ts +44 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/taskCommand.js +111 -0
- package/vscode/src/vs/sessions/contrib/chatDebug/browser/chatDebug.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.js +75 -0
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/customViewTest.contribution.js +7 -7
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +4 -4
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.js +5 -5
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditorInput.js +1 -1
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.js +7 -7
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.js +1 -1
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +5 -5
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +1 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +19 -19
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +4 -4
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +6 -6
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +2 -2
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +4 -4
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +24 -24
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.d.ts +26 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +98 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.d.ts +33 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +98 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostForkActions.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostForkActions.js +72 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModeIcon.d.ts +2 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModeIcon.js +13 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.d.ts +122 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +464 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerActionItem.d.ts +35 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerActionItem.js +90 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.d.ts +84 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +328 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +94 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.d.ts +174 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +1390 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +468 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.d.ts +7 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +48 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/media/agentHostSessionConfigPicker.css +44 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileAgentHostModePicker.d.ts +30 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileAgentHostModePicker.js +78 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +345 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputTarget.d.ts +11 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputTarget.js +26 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +6 -6
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +3 -3
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +4 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +2 -2
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +58 -58
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +38 -38
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +118 -118
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +53 -53
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.d.ts +42 -0
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +139 -0
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.d.ts +120 -0
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +741 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +2 -2
- package/vscode/src/vs/workbench/browser/layout.js +1 -1
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { append, $, EventType, addDisposableListener, EventHelper, clearNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { renderIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
|
|
5
|
+
import { EventType as EventType$1, Gesture } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/touch';
|
|
6
|
+
import { Disposable, DisposableStore, MutableDisposable, DisposableMap, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
8
|
+
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
10
|
+
import { ActionListItemKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionList';
|
|
11
|
+
import { IActionWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service';
|
|
12
|
+
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
13
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
15
|
+
import { SessionConfigKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/sessionConfigKeys';
|
|
16
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
17
|
+
import { isAgentHostProvider } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/agentHostSessionsProvider';
|
|
18
|
+
import { ISessionsProvidersService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/browser/sessionsProvidersService.service';
|
|
19
|
+
import { reportNewChatPickerClosed } from '@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/chat/browser/newChatPickerTelemetry';
|
|
20
|
+
import { didExplicitlyEnableChatPetAutopilot, ChatPetAchievementIds } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatPetAchievements';
|
|
21
|
+
import { IChatPetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatPetService.service';
|
|
22
|
+
import { getAgentHostModeIcon } from './agentHostModeIcon.js';
|
|
23
|
+
import { AgentHostPermissionPickerDelegate } from './agentHostPermissionPickerDelegate.js';
|
|
24
|
+
import { PermissionPicker } from '@codingame/monaco-vscode-katex-common/vscode/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker';
|
|
25
|
+
import { MODE_PERMISSIONS_PICKER_OPEN_ATTRIBUTE, renderModePickerTrigger, getModePermissionsPickerOptions, createModePickerPermissionsItems, AGENT_HOST_PERMISSIONS_SETTINGS_QUERY, createModePickerModeItems, getModePermissionsPickerAccessibilityProvider, isWellKnownModeSchema, getModePickerAriaLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModePickerPresentation';
|
|
26
|
+
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
27
|
+
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
28
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
29
|
+
|
|
30
|
+
let AgentHostSessionEnumPicker = class AgentHostSessionEnumPicker extends Disposable {
|
|
31
|
+
constructor(
|
|
32
|
+
_session,
|
|
33
|
+
_actionWidgetService,
|
|
34
|
+
_sessionsProvidersService,
|
|
35
|
+
_telemetryService,
|
|
36
|
+
_hoverService
|
|
37
|
+
) {
|
|
38
|
+
super();
|
|
39
|
+
this._session = _session;
|
|
40
|
+
this._actionWidgetService = _actionWidgetService;
|
|
41
|
+
this._sessionsProvidersService = _sessionsProvidersService;
|
|
42
|
+
this._telemetryService = _telemetryService;
|
|
43
|
+
this._hoverService = _hoverService;
|
|
44
|
+
this._renderDisposables = this._register(( new DisposableStore()));
|
|
45
|
+
this._triggerGesture = this._register(( new MutableDisposable()));
|
|
46
|
+
this._providerListeners = this._register(( new DisposableMap()));
|
|
47
|
+
this._pickerListener = this._register(( new MutableDisposable()));
|
|
48
|
+
this._pickerVisible = false;
|
|
49
|
+
this._register(autorun(reader => {
|
|
50
|
+
this._session.read(reader);
|
|
51
|
+
this._updateTrigger();
|
|
52
|
+
}));
|
|
53
|
+
this._register(this._sessionsProvidersService.onDidChangeProviders(e => {
|
|
54
|
+
for (const provider of e.removed) {
|
|
55
|
+
this._providerListeners.deleteAndDispose(provider.id);
|
|
56
|
+
}
|
|
57
|
+
this._watchProviders(e.added);
|
|
58
|
+
this._updateTrigger();
|
|
59
|
+
}));
|
|
60
|
+
this._watchProviders(this._sessionsProvidersService.getProviders());
|
|
61
|
+
this._register(toDisposable(() => this._hidePicker()));
|
|
62
|
+
}
|
|
63
|
+
render(container) {
|
|
64
|
+
this._renderDisposables.clear();
|
|
65
|
+
this._triggerGesture.clear();
|
|
66
|
+
this._containerElement = container;
|
|
67
|
+
const slot = append(container, $(".sessions-chat-picker-slot"));
|
|
68
|
+
this._renderDisposables.add({
|
|
69
|
+
dispose: () => slot.remove()
|
|
70
|
+
});
|
|
71
|
+
this._slotElement = slot;
|
|
72
|
+
const trigger = this._createTrigger(slot);
|
|
73
|
+
trigger.tabIndex = 0;
|
|
74
|
+
trigger.role = "button";
|
|
75
|
+
trigger.ariaHasPopup = "listbox";
|
|
76
|
+
trigger.ariaExpanded = "false";
|
|
77
|
+
this._triggerElement = trigger;
|
|
78
|
+
this._renderDisposables.add(this._hoverService.setupDelayedHover(trigger, () => ({
|
|
79
|
+
content: this._getTriggerTooltip(this._getActiveContext()?.tooltip ?? "")
|
|
80
|
+
})));
|
|
81
|
+
for (const eventType of [EventType.CLICK, EventType$1.Tap]) {
|
|
82
|
+
this._renderDisposables.add(addDisposableListener(trigger, eventType, e => {
|
|
83
|
+
EventHelper.stop(e, true);
|
|
84
|
+
this._showPicker();
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
this._renderDisposables.add(addDisposableListener(trigger, EventType.KEY_DOWN, e => {
|
|
88
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
89
|
+
EventHelper.stop(e, true);
|
|
90
|
+
this._showPicker();
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
this._updateTrigger();
|
|
94
|
+
return trigger;
|
|
95
|
+
}
|
|
96
|
+
focus() {
|
|
97
|
+
this._triggerElement?.focus();
|
|
98
|
+
}
|
|
99
|
+
_watchProviders(providers) {
|
|
100
|
+
for (const provider of providers) {
|
|
101
|
+
if (!isAgentHostProvider(provider) || ( this._providerListeners.has(provider.id))) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
this._providerListeners.set(
|
|
105
|
+
provider.id,
|
|
106
|
+
provider.onDidChangeSessionConfig(() => this._updateTrigger())
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
_createTrigger(slot) {
|
|
111
|
+
return append(slot, $("a.action-label"));
|
|
112
|
+
}
|
|
113
|
+
_getTriggerTooltip(tooltip) {
|
|
114
|
+
return tooltip;
|
|
115
|
+
}
|
|
116
|
+
_getFooterActionItems() {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
_watchActionItems(_items) {
|
|
120
|
+
return Disposable.None;
|
|
121
|
+
}
|
|
122
|
+
_handleFooterActionItem(_item) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
_onDidSelectValue(_previousValue, _selectedValue) {}
|
|
126
|
+
_getActionItems(items, currentValue) {
|
|
127
|
+
return items.map(item => ({
|
|
128
|
+
kind: ActionListItemKind.Action,
|
|
129
|
+
label: item.label,
|
|
130
|
+
detail: item.description,
|
|
131
|
+
group: {
|
|
132
|
+
title: "",
|
|
133
|
+
icon: this._getActionItemIcon(item, currentValue)
|
|
134
|
+
},
|
|
135
|
+
item: {
|
|
136
|
+
...item,
|
|
137
|
+
id: item.value,
|
|
138
|
+
checked: item.value === currentValue
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
_getAccessibilityProvider() {
|
|
143
|
+
return {
|
|
144
|
+
getWidgetAriaLabel: () => this._getWidgetAriaLabel()
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
_getListOptions() {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
_isCurrentlyResolvingConfig() {
|
|
151
|
+
const session = this._session.get();
|
|
152
|
+
if (!session) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const provider = this._sessionsProvidersService.getProvider(session.providerId);
|
|
156
|
+
if (!provider || !isAgentHostProvider(provider)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return provider.isSessionConfigResolving(session.sessionId).get();
|
|
160
|
+
}
|
|
161
|
+
showPicker(anchor, onHide) {
|
|
162
|
+
return this._showPicker(anchor, onHide);
|
|
163
|
+
}
|
|
164
|
+
_getActiveContext() {
|
|
165
|
+
const session = this._session.get();
|
|
166
|
+
if (!session) {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
const rawProvider = this._sessionsProvidersService.getProvider(session.providerId);
|
|
170
|
+
if (!rawProvider || !isAgentHostProvider(rawProvider)) {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
const config = rawProvider.getSessionConfig(session.sessionId);
|
|
174
|
+
const schema = config?.schema.properties[this._property];
|
|
175
|
+
if (!schema || !this._isWellKnownSchema(schema)) {
|
|
176
|
+
return undefined;
|
|
177
|
+
}
|
|
178
|
+
const enumValues = (schema.enum ?? []).map(value => String(value));
|
|
179
|
+
const enumLabels = schema.enumLabels ?? [];
|
|
180
|
+
const enumDescriptions = schema.enumDescriptions ?? [];
|
|
181
|
+
const items = enumValues.map((value, index) => ({
|
|
182
|
+
value,
|
|
183
|
+
label: enumLabels[index] ?? value,
|
|
184
|
+
description: enumDescriptions[index]
|
|
185
|
+
}));
|
|
186
|
+
const rawCurrent = config?.values[this._property] ?? schema.default;
|
|
187
|
+
const currentValue = typeof rawCurrent === "string" && enumValues.includes(rawCurrent) ? rawCurrent : enumValues[0] ?? "";
|
|
188
|
+
return {
|
|
189
|
+
provider: rawProvider,
|
|
190
|
+
sessionId: session.sessionId,
|
|
191
|
+
currentValue,
|
|
192
|
+
items,
|
|
193
|
+
tooltip: schema.description ?? schema.title ?? ""
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
_updateTrigger() {
|
|
197
|
+
if (!this._triggerElement || !this._slotElement || !this._containerElement) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
const ctx = this._getActiveContext();
|
|
201
|
+
if (!ctx) {
|
|
202
|
+
this._slotElement.style.display = "none";
|
|
203
|
+
this._containerElement.style.display = "none";
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
this._slotElement.style.display = "";
|
|
207
|
+
this._containerElement.style.display = "";
|
|
208
|
+
const item = ctx.items.find(i => i.value === ctx.currentValue);
|
|
209
|
+
const label = item?.label ?? ctx.currentValue;
|
|
210
|
+
const icon = this._getTriggerIcon(ctx.currentValue);
|
|
211
|
+
const isResolving = ctx.provider.isSessionConfigResolving(ctx.sessionId).get();
|
|
212
|
+
this._slotElement.classList.toggle("resolving", isResolving);
|
|
213
|
+
this._triggerElement.setAttribute("aria-disabled", isResolving ? "true" : "false");
|
|
214
|
+
this._renderTriggerLabel(this._triggerElement, label, icon);
|
|
215
|
+
this._triggerElement.ariaLabel = this._getTriggerAriaLabel(label);
|
|
216
|
+
if (this._triggerElement.role === "group") {
|
|
217
|
+
this._triggerGesture.clear();
|
|
218
|
+
} else if (!this._triggerGesture.value) {
|
|
219
|
+
this._triggerGesture.value = Gesture.addTarget(this._triggerElement);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
_renderTriggerLabel(trigger, label, icon) {
|
|
223
|
+
clearNode(trigger);
|
|
224
|
+
if (icon) {
|
|
225
|
+
append(trigger, renderIcon(icon)).ariaHidden = "true";
|
|
226
|
+
}
|
|
227
|
+
append(trigger, $("span.sessions-chat-dropdown-label", undefined, label));
|
|
228
|
+
}
|
|
229
|
+
_hidePicker() {
|
|
230
|
+
if (this._pickerVisible) {
|
|
231
|
+
this._actionWidgetService.hide();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
_showPicker(
|
|
235
|
+
anchor = this._triggerElement,
|
|
236
|
+
onHide,
|
|
237
|
+
listOptions = this._getListOptions()
|
|
238
|
+
) {
|
|
239
|
+
if (!anchor || this._actionWidgetService.isVisible) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
const ctx = this._getActiveContext();
|
|
243
|
+
if (!ctx) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
if (this._isCurrentlyResolvingConfig()) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
const actionItems = this._getActionItems(ctx.items, ctx.currentValue);
|
|
250
|
+
actionItems.push(...this._getFooterActionItems());
|
|
251
|
+
const ariaTarget = this._triggerElement?.contains(anchor) ? anchor : this._triggerElement;
|
|
252
|
+
const combinedTrigger = this._triggerElement?.classList.contains("agent-host-mode-permissions-trigger") ? this._triggerElement : undefined;
|
|
253
|
+
const delegate = {
|
|
254
|
+
onSelect: async item => {
|
|
255
|
+
if (hasKey(item, {
|
|
256
|
+
run: true
|
|
257
|
+
})) {
|
|
258
|
+
await item.run();
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
this._actionWidgetService.hide();
|
|
262
|
+
if (this._handleFooterActionItem(item)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
if (!( ctx.items.some(candidate => candidate.value === item.value))) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const previousItem = ctx.items.find(i => i.value === ctx.currentValue);
|
|
269
|
+
reportNewChatPickerClosed(this._telemetryService, {
|
|
270
|
+
id: this._telemetryId,
|
|
271
|
+
optionIdBefore: ctx.currentValue,
|
|
272
|
+
optionIdAfter: item.value,
|
|
273
|
+
optionLabelBefore: previousItem?.label ?? ctx.currentValue,
|
|
274
|
+
optionLabelAfter: item.label,
|
|
275
|
+
isPII: false
|
|
276
|
+
});
|
|
277
|
+
ctx.provider.setSessionConfigValue(ctx.sessionId, this._property, item.value).then(() => this._onDidSelectValue(ctx.currentValue, item.value)).catch(() => {});
|
|
278
|
+
},
|
|
279
|
+
onHide: () => {
|
|
280
|
+
this._pickerVisible = false;
|
|
281
|
+
this._pickerListener.clear();
|
|
282
|
+
ariaTarget?.setAttribute("aria-expanded", "false");
|
|
283
|
+
combinedTrigger?.removeAttribute(MODE_PERMISSIONS_PICKER_OPEN_ATTRIBUTE);
|
|
284
|
+
anchor.focus();
|
|
285
|
+
onHide?.();
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
this._pickerVisible = true;
|
|
289
|
+
ariaTarget?.setAttribute("aria-expanded", "true");
|
|
290
|
+
this._actionWidgetService.show(
|
|
291
|
+
this._pickerId,
|
|
292
|
+
false,
|
|
293
|
+
actionItems,
|
|
294
|
+
delegate,
|
|
295
|
+
anchor,
|
|
296
|
+
undefined,
|
|
297
|
+
[],
|
|
298
|
+
this._getAccessibilityProvider(),
|
|
299
|
+
listOptions
|
|
300
|
+
);
|
|
301
|
+
combinedTrigger?.setAttribute(MODE_PERMISSIONS_PICKER_OPEN_ATTRIBUTE, "true");
|
|
302
|
+
this._pickerListener.value = this._watchActionItems(actionItems);
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
AgentHostSessionEnumPicker = ( __decorate([( __param(1, IActionWidgetService)), ( __param(2, ISessionsProvidersService)), ( __param(3, ITelemetryService)), ( __param(4, IHoverService))], AgentHostSessionEnumPicker));
|
|
307
|
+
let AgentHostModePicker = class AgentHostModePicker extends AgentHostSessionEnumPicker {
|
|
308
|
+
constructor(
|
|
309
|
+
session,
|
|
310
|
+
actionWidgetService,
|
|
311
|
+
sessionsProvidersService,
|
|
312
|
+
telemetryService,
|
|
313
|
+
hoverService,
|
|
314
|
+
_chatPetService,
|
|
315
|
+
instantiationService,
|
|
316
|
+
_configurationService,
|
|
317
|
+
_preferencesService
|
|
318
|
+
) {
|
|
319
|
+
super(
|
|
320
|
+
session,
|
|
321
|
+
actionWidgetService,
|
|
322
|
+
sessionsProvidersService,
|
|
323
|
+
telemetryService,
|
|
324
|
+
hoverService
|
|
325
|
+
);
|
|
326
|
+
this._chatPetService = _chatPetService;
|
|
327
|
+
this._configurationService = _configurationService;
|
|
328
|
+
this._preferencesService = _preferencesService;
|
|
329
|
+
this._splitTrigger = this._register(( new MutableDisposable()));
|
|
330
|
+
this._property = SessionConfigKey.Mode;
|
|
331
|
+
this._pickerId = "agentHostModePicker";
|
|
332
|
+
this._telemetryId = "NewChatAgentHostModePicker";
|
|
333
|
+
this._permissionDelegate = this._register(
|
|
334
|
+
instantiationService.createInstance(AgentHostPermissionPickerDelegate, session)
|
|
335
|
+
);
|
|
336
|
+
this._permissionPicker = this._register(
|
|
337
|
+
instantiationService.createInstance(PermissionPicker, this._permissionDelegate)
|
|
338
|
+
);
|
|
339
|
+
this._register(autorun(reader => {
|
|
340
|
+
session.read(reader);
|
|
341
|
+
this._permissionDelegate.isModePickerCombined.read(reader);
|
|
342
|
+
this._permissionDelegate.currentPermissionLevel.read(reader);
|
|
343
|
+
this._permissionDelegate.isResolving.read(reader);
|
|
344
|
+
this._permissionDelegate.sandboxToggleSettingId.read(reader);
|
|
345
|
+
this._permissionDelegate.managedSandboxEnforced.read(reader);
|
|
346
|
+
this._permissionDelegate.managedSandboxAllowsBypass.read(reader);
|
|
347
|
+
this._hidePicker();
|
|
348
|
+
this._updateTrigger();
|
|
349
|
+
}));
|
|
350
|
+
this._register(autorun(reader => {
|
|
351
|
+
this._permissionDelegate.sandboxEnabled.read(reader);
|
|
352
|
+
this._updateTrigger();
|
|
353
|
+
}));
|
|
354
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
355
|
+
if (e.affectsConfiguration(ChatConfiguration.GlobalAutoApprove) || e.affectsConfiguration(ChatConfiguration.AssistedPermissionsEnabled)) {
|
|
356
|
+
this._hidePicker();
|
|
357
|
+
}
|
|
358
|
+
if (e.affectsConfiguration(ChatConfiguration.PermissionsSandboxToggleEnabled) || ( this._permissionDelegate.sandboxToggleConfigurationKeys.some(key => e.affectsConfiguration(key)))) {
|
|
359
|
+
this._updateTrigger();
|
|
360
|
+
}
|
|
361
|
+
}));
|
|
362
|
+
}
|
|
363
|
+
_renderTriggerLabel(trigger, label, icon) {
|
|
364
|
+
const previous = this._splitTrigger.value;
|
|
365
|
+
this._splitTrigger.clear();
|
|
366
|
+
if (this._permissionDelegate.isModePickerCombined.get()) {
|
|
367
|
+
this._splitTrigger.value = renderModePickerTrigger(trigger, {
|
|
368
|
+
label,
|
|
369
|
+
icon,
|
|
370
|
+
labelClassName: "sessions-chat-dropdown-label"
|
|
371
|
+
}, this._permissionPicker.presentation, (anchor, openPermissions) => {
|
|
372
|
+
const initialFocusItemId = openPermissions ? `permissionPicker.${this._permissionDelegate.currentPermissionLevel.get()}` : this._getActiveContext()?.currentValue;
|
|
373
|
+
this._showPicker(
|
|
374
|
+
anchor,
|
|
375
|
+
undefined,
|
|
376
|
+
getModePermissionsPickerOptions(openPermissions, initialFocusItemId)
|
|
377
|
+
);
|
|
378
|
+
}, previous);
|
|
379
|
+
} else {
|
|
380
|
+
trigger.classList.remove("agent-host-mode-permissions-trigger");
|
|
381
|
+
trigger.role = "button";
|
|
382
|
+
trigger.tabIndex = 0;
|
|
383
|
+
trigger.ariaHasPopup = "listbox";
|
|
384
|
+
super._renderTriggerLabel(trigger, label, icon);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
_createTrigger(slot) {
|
|
388
|
+
return append(slot, $("div.action-label"));
|
|
389
|
+
}
|
|
390
|
+
focus() {
|
|
391
|
+
(this._splitTrigger.value?.modeButton ?? this._triggerElement)?.focus();
|
|
392
|
+
}
|
|
393
|
+
_showPicker(
|
|
394
|
+
anchor = this._triggerElement,
|
|
395
|
+
onHide,
|
|
396
|
+
listOptions = this._getListOptions()
|
|
397
|
+
) {
|
|
398
|
+
return super._showPicker(
|
|
399
|
+
anchor === this._triggerElement ? this._splitTrigger.value?.modeButton ?? anchor : anchor,
|
|
400
|
+
onHide,
|
|
401
|
+
listOptions
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
_getTriggerTooltip(tooltip) {
|
|
405
|
+
return this._permissionDelegate.isModePickerCombined.get() ? this._triggerElement?.ariaLabel ?? tooltip : tooltip;
|
|
406
|
+
}
|
|
407
|
+
_getFooterActionItems() {
|
|
408
|
+
const session = this._session.get();
|
|
409
|
+
return this._permissionDelegate.isModePickerCombined.get() ? [...createModePickerPermissionsItems(
|
|
410
|
+
this._permissionPicker.presentation,
|
|
411
|
+
this._permissionPicker.getActionListItems(() => this._session.get() === session),
|
|
412
|
+
async () => {
|
|
413
|
+
this._hidePicker();
|
|
414
|
+
await this._preferencesService.openSettings({
|
|
415
|
+
jsonEditor: false,
|
|
416
|
+
query: AGENT_HOST_PERMISSIONS_SETTINGS_QUERY
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
)] : [];
|
|
420
|
+
}
|
|
421
|
+
_getActionItems(items, currentValue) {
|
|
422
|
+
return createModePickerModeItems(
|
|
423
|
+
super._getActionItems(items, currentValue),
|
|
424
|
+
this._permissionDelegate.isModePickerCombined.get()
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
_watchActionItems(items) {
|
|
428
|
+
return this._permissionPicker.watchSandboxToggle(items);
|
|
429
|
+
}
|
|
430
|
+
_getAccessibilityProvider() {
|
|
431
|
+
return {
|
|
432
|
+
...super._getAccessibilityProvider(),
|
|
433
|
+
...getModePermissionsPickerAccessibilityProvider(this._permissionDelegate.isModePickerCombined.get())
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
_onDidSelectValue(previousValue, selectedValue) {
|
|
437
|
+
if (didExplicitlyEnableChatPetAutopilot(previousValue, selectedValue)) {
|
|
438
|
+
this._chatPetService.unlockAchievement(ChatPetAchievementIds.AutopilotEnabled);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
_getListOptions() {
|
|
442
|
+
return this._permissionDelegate.isModePickerCombined.get() ? getModePermissionsPickerOptions(false, this._getActiveContext()?.currentValue) : {
|
|
443
|
+
minWidth: 260
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
_isWellKnownSchema(schema) {
|
|
447
|
+
return isWellKnownModeSchema(schema);
|
|
448
|
+
}
|
|
449
|
+
_getTriggerIcon(value) {
|
|
450
|
+
return getAgentHostModeIcon(value);
|
|
451
|
+
}
|
|
452
|
+
_getActionItemIcon(item) {
|
|
453
|
+
return getAgentHostModeIcon(item.value);
|
|
454
|
+
}
|
|
455
|
+
_getTriggerAriaLabel(label) {
|
|
456
|
+
return this._permissionDelegate.isModePickerCombined.get() ? getModePickerAriaLabel(label, this._permissionPicker.presentation) : ( localize(4196, "Pick Agent Mode, {0}", label));
|
|
457
|
+
}
|
|
458
|
+
_getWidgetAriaLabel() {
|
|
459
|
+
return this._permissionDelegate.isModePickerCombined.get() ? ( localize(4197, "Mode and Permissions Picker")) : ( localize(4198, "Agent Mode Picker"));
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
AgentHostModePicker = ( __decorate([( __param(1, IActionWidgetService)), ( __param(2, ISessionsProvidersService)), ( __param(3, ITelemetryService)), ( __param(4, IHoverService)), ( __param(5, IChatPetService)), ( __param(6, IInstantiationService)), ( __param(7, IConfigurationService)), ( __param(8, IPreferencesService))], AgentHostModePicker));
|
|
463
|
+
|
|
464
|
+
export { AgentHostModePicker, AgentHostSessionEnumPicker };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IObservable, ISettableObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
2
|
+
import { MenuItemAction } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
3
|
+
import { IActionWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
6
|
+
import { IDialogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service";
|
|
7
|
+
import { IHoverService } from "@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service";
|
|
8
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
9
|
+
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
10
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
11
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
12
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
13
|
+
import { IChatInputPickerOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem";
|
|
14
|
+
import { IChatInputPickerResponsiveState } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerResponsiveLayout";
|
|
15
|
+
import { PermissionPickerActionItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem";
|
|
16
|
+
import { IActiveSession } from "@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionsManagement";
|
|
17
|
+
/**
|
|
18
|
+
* Agent host wrapper around the workbench {@link PermissionPickerActionItem}
|
|
19
|
+
* for use in the running chat widget's secondary toolbar
|
|
20
|
+
* (`MenuId.ChatInputSecondary`). Owns its
|
|
21
|
+
* {@link AgentHostPermissionPickerDelegate} and reactively hides itself when
|
|
22
|
+
* the active session's `autoApprove` schema doesn't match the well-known
|
|
23
|
+
* shape.
|
|
24
|
+
*/
|
|
25
|
+
export declare class AgentHostPermissionPickerActionItem extends PermissionPickerActionItem implements IChatInputPickerResponsiveState {
|
|
26
|
+
private readonly _delegate;
|
|
27
|
+
private readonly _compact;
|
|
28
|
+
constructor(action: MenuItemAction, pickerOptions: IChatInputPickerOptions & {
|
|
29
|
+
readonly compact: ISettableObservable<boolean>;
|
|
30
|
+
}, session: IObservable<IActiveSession | undefined>, instantiationService: IInstantiationService, actionWidgetService: IActionWidgetService, keybindingService: IKeybindingService, contextKeyService: IContextKeyService, telemetryService: ITelemetryService, configurationService: IConfigurationService, dialogService: IDialogService, openerService: IOpenerService, storageService: IStorageService, hoverService: IHoverService);
|
|
31
|
+
isCompact(): boolean;
|
|
32
|
+
setCompact(compact: boolean): void;
|
|
33
|
+
render(container: HTMLElement): void;
|
|
34
|
+
protected updateEnabled(): void;
|
|
35
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
4
|
+
import { IActionWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actionWidget/browser/actionWidget.service';
|
|
5
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
6
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
7
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
8
|
+
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
9
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
11
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
12
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
13
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
14
|
+
import { PermissionPickerActionItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem';
|
|
15
|
+
import { AgentHostPermissionPickerDelegate } from './agentHostPermissionPickerDelegate.js';
|
|
16
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
17
|
+
|
|
18
|
+
let AgentHostPermissionPickerActionItem = class AgentHostPermissionPickerActionItem extends PermissionPickerActionItem {
|
|
19
|
+
constructor(
|
|
20
|
+
action,
|
|
21
|
+
pickerOptions,
|
|
22
|
+
session,
|
|
23
|
+
instantiationService,
|
|
24
|
+
actionWidgetService,
|
|
25
|
+
keybindingService,
|
|
26
|
+
contextKeyService,
|
|
27
|
+
telemetryService,
|
|
28
|
+
configurationService,
|
|
29
|
+
dialogService,
|
|
30
|
+
openerService,
|
|
31
|
+
storageService,
|
|
32
|
+
hoverService
|
|
33
|
+
) {
|
|
34
|
+
const delegate = instantiationService.createInstance(AgentHostPermissionPickerDelegate, session);
|
|
35
|
+
super(
|
|
36
|
+
action,
|
|
37
|
+
delegate,
|
|
38
|
+
pickerOptions,
|
|
39
|
+
actionWidgetService,
|
|
40
|
+
keybindingService,
|
|
41
|
+
contextKeyService,
|
|
42
|
+
telemetryService,
|
|
43
|
+
configurationService,
|
|
44
|
+
dialogService,
|
|
45
|
+
openerService,
|
|
46
|
+
storageService,
|
|
47
|
+
hoverService
|
|
48
|
+
);
|
|
49
|
+
this._delegate = this._register(delegate);
|
|
50
|
+
this._compact = pickerOptions.compact;
|
|
51
|
+
this._register(autorun(reader => {
|
|
52
|
+
delegate.currentPermissionLevel.read(reader);
|
|
53
|
+
this.refresh();
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
isCompact() {
|
|
57
|
+
return this._compact.get();
|
|
58
|
+
}
|
|
59
|
+
setCompact(compact) {
|
|
60
|
+
this._compact.set(compact, undefined);
|
|
61
|
+
}
|
|
62
|
+
render(container) {
|
|
63
|
+
super.render(container);
|
|
64
|
+
this._register(autorun(reader => {
|
|
65
|
+
const visible = this._delegate.isApplicable.read(reader);
|
|
66
|
+
container.style.display = visible ? "" : "none";
|
|
67
|
+
}));
|
|
68
|
+
this._register(autorun(reader => {
|
|
69
|
+
const isResolving = this._delegate.isResolving.read(reader);
|
|
70
|
+
const element = this.element;
|
|
71
|
+
if (!element) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
element.classList.toggle("sessions-chat-config-resolving", isResolving);
|
|
75
|
+
this.setDropdownEnabled(!isResolving);
|
|
76
|
+
if (isResolving) {
|
|
77
|
+
element.setAttribute("aria-disabled", "true");
|
|
78
|
+
} else {
|
|
79
|
+
element.removeAttribute("aria-disabled");
|
|
80
|
+
}
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
updateEnabled() {
|
|
84
|
+
super.updateEnabled();
|
|
85
|
+
this.setDropdownEnabled(!this._delegate.isResolving.get());
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
AgentHostPermissionPickerActionItem = ( __decorate([( __param(3, IInstantiationService)), ( __param(4, IActionWidgetService)), ( __param(5, IKeybindingService)), ( __param(6, IContextKeyService)), ( __param(7, ITelemetryService)), ( __param(8, IConfigurationService)), ( __param(9, IDialogService)), ( __param(10, IOpenerService)), ( __param(11, IStorageService)), ( __param(12, IHoverService))], AgentHostPermissionPickerActionItem));
|
|
89
|
+
|
|
90
|
+
export { AgentHostPermissionPickerActionItem };
|