@codingame/monaco-vscode-authentication-service-override 22.1.8 → 23.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-authentication-service-override",
3
- "version": "22.1.8",
3
+ "version": "23.0.0",
4
4
  "private": false,
5
5
  "description": "VSCode public API plugged on the monaco editor - authentication service-override",
6
6
  "keywords": [],
@@ -15,10 +15,10 @@
15
15
  },
16
16
  "type": "module",
17
17
  "dependencies": {
18
- "@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "22.1.8",
19
- "@codingame/monaco-vscode-api": "22.1.8",
20
- "@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common": "22.1.8",
21
- "@codingame/monaco-vscode-f22e7e55-aee8-5b52-a6bc-950efd9f5890-common": "22.1.8"
18
+ "@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common": "23.0.0",
19
+ "@codingame/monaco-vscode-4bf376c2-03c7-58cb-8303-c67aeefa3d3d-common": "23.0.0",
20
+ "@codingame/monaco-vscode-api": "23.0.0",
21
+ "@codingame/monaco-vscode-f22e7e55-aee8-5b52-a6bc-950efd9f5890-common": "23.0.0"
22
22
  },
23
23
  "main": "index.js",
24
24
  "module": "index.js",
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
3
3
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
4
4
  import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
5
  import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
6
- import { Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
6
+ import { Action2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
7
7
  import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
8
8
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
9
  import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
@@ -16,9 +16,13 @@ class ManageAccountPreferencesForExtensionAction extends Action2 {
16
16
  constructor() {
17
17
  super({
18
18
  id: '_manageAccountPreferencesForExtension',
19
- title: ( localize2(4345, "Manage Extension Account Preferences")),
20
- category: ( localize2(4346, "Accounts")),
21
- f1: true
19
+ title: ( localize2(4367, "Manage Extension Account Preferences...")),
20
+ category: ( localize2(4368, "Accounts")),
21
+ f1: true,
22
+ menu: [{
23
+ id: MenuId.AccountsContext,
24
+ order: 100,
25
+ }],
22
26
  });
23
27
  }
24
28
  run(accessor, extensionId, providerId) {
@@ -43,8 +47,8 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
43
47
  label: ext.displayName ?? ext.name,
44
48
  id: ext.identifier.value
45
49
  }))), {
46
- placeHolder: ( localize(4347, "Select an extension to manage account preferences for")),
47
- title: ( localize(4348, "Manage Extension Account Preferences"))
50
+ placeHolder: ( localize(4369, "Select an extension to manage account preferences for")),
51
+ title: ( localize(4370, "Manage Extension Account Preferences"))
48
52
  });
49
53
  extensionId = result?.id;
50
54
  }
@@ -59,7 +63,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
59
63
  const extensionQuery = this._authenticationQueryService.extension(extensionId);
60
64
  const providersWithAccess = await extensionQuery.getProvidersWithAccess();
61
65
  if (!providersWithAccess.length) {
62
- await this._dialogService.info(( localize(4349, "This extension has not used any accounts yet.")));
66
+ await this._dialogService.info(( localize(4371, "This extension has not used any accounts yet.")));
63
67
  return;
64
68
  }
65
69
  providerId = providersWithAccess[0];
@@ -69,10 +73,10 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
69
73
  id: providerId,
70
74
  }))), {
71
75
  placeHolder: ( localize(
72
- 4350,
76
+ 4372,
73
77
  "Select an authentication provider to manage account preferences for"
74
78
  )),
75
- title: ( localize(4348, "Manage Extension Account Preferences"))
79
+ title: ( localize(4370, "Manage Extension Account Preferences"))
76
80
  });
77
81
  if (!result) {
78
82
  return;
@@ -93,7 +97,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
93
97
  items.push({
94
98
  providerId,
95
99
  scopes: lastUsedScopes,
96
- label: ( localize(4351, "Use a new account...")),
100
+ label: ( localize(4373, "Use a new account...")),
97
101
  });
98
102
  }
99
103
  }
@@ -112,12 +116,12 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
112
116
  disposableStore.dispose();
113
117
  }));
114
118
  picker.placeholder = ( localize(
115
- 4352,
119
+ 4374,
116
120
  "Manage '{0}' account preferences for {1}...",
117
121
  extensionLabel,
118
122
  providerLabel
119
123
  ));
120
- picker.title = ( localize(4353, "'{0}' Account Preferences For This Workspace", extensionLabel));
124
+ picker.title = ( localize(4375, "'{0}' Account Preferences For This Workspace", extensionLabel));
121
125
  picker.sortByLabel = false;
122
126
  disposableStore.add(picker.onDidAccept(async () => {
123
127
  picker.hide();
@@ -131,7 +135,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
131
135
  label: a.label,
132
136
  account: a,
133
137
  providerId,
134
- description: ( localize(4354, "Current account")),
138
+ description: ( localize(4376, "Current account")),
135
139
  picked: true
136
140
  }
137
141
  : {
@@ -141,7 +145,7 @@ let ManageAccountPreferenceForExtensionActionImpl = class ManageAccountPreferenc
141
145
  }));
142
146
  }
143
147
  _handleNoAccounts(picker) {
144
- picker.validationMessage = ( localize(4355, "No accounts are currently used by this extension."));
148
+ picker.validationMessage = ( localize(4377, "No accounts are currently used by this extension."));
145
149
  picker.buttons = [this._quickInputService.backButton];
146
150
  picker.show();
147
151
  return Event.filter(picker.onDidTriggerButton, (e) => e === this._quickInputService.backButton)(() => this.run());
@@ -16,8 +16,8 @@ class ManageAccountPreferencesForMcpServerAction extends Action2 {
16
16
  constructor() {
17
17
  super({
18
18
  id: '_manageAccountPreferencesForMcpServer',
19
- title: ( localize2(4356, "Manage MCP Server Account Preferences")),
20
- category: ( localize2(4357, "Accounts")),
19
+ title: ( localize2(4378, "Manage MCP Server Account Preferences")),
20
+ category: ( localize2(4379, "Accounts")),
21
21
  f1: false
22
22
  });
23
23
  }
@@ -46,7 +46,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
46
46
  const mcpServerQuery = this._authenticationQueryService.mcpServer(mcpServerId);
47
47
  const providersWithAccess = await mcpServerQuery.getProvidersWithAccess();
48
48
  if (!providersWithAccess.length) {
49
- await this._dialogService.info(( localize(4358, "This MCP server has not used any accounts yet.")));
49
+ await this._dialogService.info(( localize(4380, "This MCP server has not used any accounts yet.")));
50
50
  return;
51
51
  }
52
52
  providerId = providersWithAccess[0];
@@ -56,10 +56,10 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
56
56
  id: providerId,
57
57
  }))), {
58
58
  placeHolder: ( localize(
59
- 4359,
59
+ 4381,
60
60
  "Select an authentication provider to manage account preferences for"
61
61
  )),
62
- title: ( localize(4360, "Manage MCP Server Account Preferences"))
62
+ title: ( localize(4382, "Manage MCP Server Account Preferences"))
63
63
  });
64
64
  if (!result) {
65
65
  return;
@@ -80,7 +80,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
80
80
  items.push({
81
81
  providerId: providerId,
82
82
  scopes: lastUsedScopes,
83
- label: ( localize(4361, "Use a new account...")),
83
+ label: ( localize(4383, "Use a new account...")),
84
84
  });
85
85
  }
86
86
  }
@@ -99,12 +99,12 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
99
99
  disposableStore.dispose();
100
100
  }));
101
101
  picker.placeholder = ( localize(
102
- 4362,
102
+ 4384,
103
103
  "Manage '{0}' account preferences for {1}...",
104
104
  mcpServerLabel,
105
105
  providerLabel
106
106
  ));
107
- picker.title = ( localize(4363, "'{0}' Account Preferences For This Workspace", mcpServerLabel));
107
+ picker.title = ( localize(4385, "'{0}' Account Preferences For This Workspace", mcpServerLabel));
108
108
  picker.sortByLabel = false;
109
109
  disposableStore.add(picker.onDidAccept(async () => {
110
110
  picker.hide();
@@ -118,7 +118,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
118
118
  label: a.label,
119
119
  account: a,
120
120
  providerId,
121
- description: ( localize(4364, "Current account")),
121
+ description: ( localize(4386, "Current account")),
122
122
  picked: true
123
123
  }
124
124
  : {
@@ -128,7 +128,7 @@ let ManageAccountPreferenceForMcpServerActionImpl = class ManageAccountPreferenc
128
128
  }));
129
129
  }
130
130
  _handleNoAccounts(picker) {
131
- picker.validationMessage = ( localize(4365, "No accounts are currently used by this MCP server."));
131
+ picker.validationMessage = ( localize(4387, "No accounts are currently used by this MCP server."));
132
132
  picker.buttons = [this._quickInputService.backButton];
133
133
  picker.show();
134
134
  return Event.filter(picker.onDidTriggerButton, (e) => e === this._quickInputService.backButton)(() => this.run());
@@ -0,0 +1,6 @@
1
+ import { Action2 } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
2
+ import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
3
+ export declare class ManageAccountsAction extends Action2 {
4
+ constructor();
5
+ run(accessor: ServicesAccessor): Promise<void>;
6
+ }
@@ -0,0 +1,118 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
4
+ import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
6
+ import { Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
7
+ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
8
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
9
+ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
10
+ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
11
+ import { ISecretStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/secrets/common/secrets.service';
12
+ import { getCurrentAuthenticationSessionInfo } from '@codingame/monaco-vscode-f22e7e55-aee8-5b52-a6bc-950efd9f5890-common/vscode/vs/workbench/services/authentication/browser/authenticationService';
13
+ import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
14
+
15
+ class ManageAccountsAction extends Action2 {
16
+ constructor() {
17
+ super({
18
+ id: 'workbench.action.manageAccounts',
19
+ title: ( localize2(4388, "Manage Accounts")),
20
+ category: ( localize2(4389, "Accounts")),
21
+ f1: true
22
+ });
23
+ }
24
+ run(accessor) {
25
+ const instantiationService = accessor.get(IInstantiationService);
26
+ return instantiationService.createInstance(ManageAccountsActionImpl).run();
27
+ }
28
+ }
29
+ let ManageAccountsActionImpl = class ManageAccountsActionImpl {
30
+ constructor(quickInputService, authenticationService, commandService, secretStorageService, productService) {
31
+ this.quickInputService = quickInputService;
32
+ this.authenticationService = authenticationService;
33
+ this.commandService = commandService;
34
+ this.secretStorageService = secretStorageService;
35
+ this.productService = productService;
36
+ }
37
+ async run() {
38
+ const placeHolder = ( localize(4390, "Select an account to manage"));
39
+ const accounts = await this.listAccounts();
40
+ if (!accounts.length) {
41
+ await this.quickInputService.pick([{ label: ( localize(4391, "There are no active accounts.")) }], { placeHolder });
42
+ return;
43
+ }
44
+ const account = await this.quickInputService.pick(accounts, { placeHolder, matchOnDescription: true });
45
+ if (!account) {
46
+ return;
47
+ }
48
+ await this.showAccountActions(account);
49
+ }
50
+ async listAccounts() {
51
+ const activeSession = ( new Lazy(
52
+ () => getCurrentAuthenticationSessionInfo(this.secretStorageService, this.productService)
53
+ ));
54
+ const accounts = [];
55
+ for (const providerId of this.authenticationService.getProviderIds()) {
56
+ const provider = this.authenticationService.getProvider(providerId);
57
+ for (const { label, id } of await this.authenticationService.getAccounts(providerId)) {
58
+ accounts.push({
59
+ label,
60
+ description: provider.label,
61
+ providerId,
62
+ canUseMcp: !!provider.authorizationServers?.length,
63
+ canSignOut: async () => this.canSignOut(provider, id, await activeSession.value)
64
+ });
65
+ }
66
+ }
67
+ return accounts;
68
+ }
69
+ async canSignOut(provider, accountId, session) {
70
+ if (session && !session.canSignOut && session.providerId === provider.id) {
71
+ const sessions = await this.authenticationService.getSessions(provider.id);
72
+ return !( sessions.some(o => o.id === session.id && o.account.id === accountId));
73
+ }
74
+ return true;
75
+ }
76
+ async showAccountActions(account) {
77
+ const { providerId, label: accountLabel, canUseMcp, canSignOut } = account;
78
+ const store = ( new DisposableStore());
79
+ const quickPick = store.add(this.quickInputService.createQuickPick());
80
+ quickPick.title = ( localize(4392, "Manage '{0}'", accountLabel));
81
+ quickPick.placeholder = ( localize(4393, "Select an action"));
82
+ const items = [{
83
+ label: ( localize(4394, "Manage Trusted Extensions")),
84
+ action: () => this.commandService.executeCommand('_manageTrustedExtensionsForAccount', { providerId, accountLabel })
85
+ }];
86
+ if (canUseMcp) {
87
+ items.push({
88
+ label: ( localize(4395, "Manage Trusted MCP Servers")),
89
+ action: () => this.commandService.executeCommand('_manageTrustedMCPServersForAccount', { providerId, accountLabel })
90
+ });
91
+ }
92
+ if (await canSignOut()) {
93
+ items.push({
94
+ label: ( localize(4396, "Sign Out")),
95
+ action: () => this.commandService.executeCommand('_signOutOfAccount', { providerId, accountLabel })
96
+ });
97
+ }
98
+ quickPick.items = items;
99
+ store.add(quickPick.onDidAccept(() => {
100
+ const selected = quickPick.selectedItems[0];
101
+ if (selected) {
102
+ quickPick.hide();
103
+ selected.action();
104
+ }
105
+ }));
106
+ store.add(quickPick.onDidHide(() => store.dispose()));
107
+ quickPick.show();
108
+ }
109
+ };
110
+ ManageAccountsActionImpl = ( __decorate([
111
+ ( __param(0, IQuickInputService)),
112
+ ( __param(1, IAuthenticationService)),
113
+ ( __param(2, ICommandService)),
114
+ ( __param(3, ISecretStorageService)),
115
+ ( __param(4, IProductService))
116
+ ], ManageAccountsActionImpl));
117
+
118
+ export { ManageAccountsAction };
@@ -11,8 +11,8 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
11
11
  constructor() {
12
12
  super({
13
13
  id: RemoveDynamicAuthenticationProvidersAction.ID,
14
- title: ( localize2(4366, 'Remove Dynamic Authentication Providers')),
15
- category: ( localize2(4367, 'Authentication')),
14
+ title: ( localize2(4397, 'Remove Dynamic Authentication Providers')),
15
+ category: ( localize2(4398, 'Authentication')),
16
16
  f1: true
17
17
  });
18
18
  }
@@ -23,16 +23,16 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
23
23
  const dialogService = accessor.get(IDialogService);
24
24
  const interactedProviders = dynamicAuthStorageService.getInteractedProviders();
25
25
  if (interactedProviders.length === 0) {
26
- await dialogService.info(( localize(4368, 'No dynamic authentication providers')), ( localize(4369, 'No dynamic authentication providers have been used yet.')));
26
+ await dialogService.info(( localize(4399, 'No dynamic authentication providers')), ( localize(4400, 'No dynamic authentication providers have been used yet.')));
27
27
  return;
28
28
  }
29
29
  const items = ( interactedProviders.map(provider => ({
30
30
  label: provider.label,
31
- description: ( localize(4370, 'Client ID: {0}', provider.clientId)),
31
+ description: ( localize(4401, 'Client ID: {0}', provider.clientId)),
32
32
  provider
33
33
  })));
34
34
  const selected = await quickInputService.pick(items, {
35
- placeHolder: ( localize(4371, 'Select a dynamic authentication provider to remove')),
35
+ placeHolder: ( localize(4402, 'Select a dynamic authentication provider to remove')),
36
36
  canPickMany: true
37
37
  });
38
38
  if (!selected || selected.length === 0) {
@@ -41,12 +41,12 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
41
41
  const providerNames = ( selected.map(item => item.provider.label)).join(', ');
42
42
  const message = selected.length === 1
43
43
  ? ( localize(
44
- 4372,
44
+ 4403,
45
45
  'Are you sure you want to remove the dynamic authentication provider "{0}"?',
46
46
  providerNames
47
47
  ))
48
48
  : ( localize(
49
- 4373,
49
+ 4404,
50
50
  'Are you sure you want to remove {0} dynamic authentication providers: {1}?',
51
51
  selected.length,
52
52
  providerNames
@@ -54,10 +54,10 @@ class RemoveDynamicAuthenticationProvidersAction extends Action2 {
54
54
  const result = await dialogService.confirm({
55
55
  message,
56
56
  detail: ( localize(
57
- 4374,
57
+ 4405,
58
58
  'This will remove all stored authentication data for the selected provider(s). You will need to re-authenticate if you use these providers again.'
59
59
  )),
60
- primaryButton: ( localize(4375, 'Remove')),
60
+ primaryButton: ( localize(4406, 'Remove')),
61
61
  type: 'warning'
62
62
  });
63
63
  if (!result.confirmed) {
@@ -13,13 +13,14 @@ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platf
13
13
  import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
14
14
  import { IAuthenticationQueryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authenticationQuery.service';
15
15
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
16
+ import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
16
17
 
17
18
  class ManageTrustedExtensionsForAccountAction extends Action2 {
18
19
  constructor() {
19
20
  super({
20
21
  id: '_manageTrustedExtensionsForAccount',
21
- title: ( localize2(4376, "Manage Trusted Extensions For Account")),
22
- category: ( localize2(4377, "Accounts")),
22
+ title: ( localize2(4407, "Manage Trusted Extensions For Account")),
23
+ category: ( localize2(4408, "Accounts")),
23
24
  f1: true
24
25
  });
25
26
  }
@@ -29,13 +30,22 @@ class ManageTrustedExtensionsForAccountAction extends Action2 {
29
30
  }
30
31
  }
31
32
  let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsForAccountActionImpl {
32
- constructor(_extensionService, _dialogService, _quickInputService, _authenticationService, _authenticationQueryService, _commandService) {
33
+ constructor(_extensionService, _dialogService, _quickInputService, _authenticationService, _authenticationQueryService, _commandService, _extensionsWorkbenchService) {
33
34
  this._extensionService = _extensionService;
34
35
  this._dialogService = _dialogService;
35
36
  this._quickInputService = _quickInputService;
36
37
  this._authenticationService = _authenticationService;
37
38
  this._authenticationQueryService = _authenticationQueryService;
38
39
  this._commandService = _commandService;
40
+ this._extensionsWorkbenchService = _extensionsWorkbenchService;
41
+ this._viewDetailsButton = {
42
+ tooltip: ( localize(4409, "View extension details")),
43
+ iconClass: ThemeIcon.asClassName(Codicon.info),
44
+ };
45
+ this._managePreferencesButton = {
46
+ tooltip: ( localize(4410, "Manage account preferences for this extension")),
47
+ iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
48
+ };
39
49
  }
40
50
  async run(options) {
41
51
  const accountQuery = await this._resolveAccountQuery(options?.providerId, options?.accountLabel);
@@ -57,7 +67,7 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
57
67
  }
58
68
  const accounts = await this._getAllAvailableAccounts();
59
69
  const pick = await this._quickInputService.pick(accounts, {
60
- placeHolder: ( localize(4378, "Pick an account to manage trusted extensions for")),
70
+ placeHolder: ( localize(4411, "Pick an account to manage trusted extensions for")),
61
71
  matchOnDescription: true,
62
72
  });
63
73
  return pick ? this._authenticationQueryService.provider(pick.providerId).account(pick.label) : undefined;
@@ -101,28 +111,29 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
101
111
  };
102
112
  }));
103
113
  if (!filteredExtensions.length) {
104
- this._dialogService.info(( localize(4379, "This account has not been used by any extensions.")));
114
+ this._dialogService.info(( localize(4412, "This account has not been used by any extensions.")));
105
115
  return [];
106
116
  }
107
117
  const trustedExtensions = filteredExtensions.filter(e => e.trusted);
108
118
  const otherExtensions = filteredExtensions.filter(e => !e.trusted);
109
119
  const sortByLastUsed = (a, b) => (b.lastUsed || 0) - (a.lastUsed || 0);
120
+ const _toQuickPickItem = this._toQuickPickItem.bind(this);
110
121
  return [
111
- ...( otherExtensions.sort(sortByLastUsed).map(this._toQuickPickItem)),
112
- { type: 'separator', label: ( localize(4380, "Trusted by Microsoft")) },
113
- ...( trustedExtensions.sort(sortByLastUsed).map(this._toQuickPickItem))
122
+ ...( otherExtensions.sort(sortByLastUsed).map(_toQuickPickItem)),
123
+ { type: 'separator', label: ( localize(4413, "Trusted by Microsoft")) },
124
+ ...( trustedExtensions.sort(sortByLastUsed).map(_toQuickPickItem))
114
125
  ];
115
126
  }
116
127
  _toQuickPickItem(extension) {
117
128
  const lastUsed = extension.lastUsed;
118
129
  const description = lastUsed
119
- ? ( localize(4381, "Last used this account {0}", fromNow(lastUsed, true)))
120
- : ( localize(4382, "Has not used this account"));
130
+ ? ( localize(4414, "Last used this account {0}", fromNow(lastUsed, true)))
131
+ : ( localize(4415, "Has not used this account"));
121
132
  let tooltip;
122
133
  let disabled;
123
134
  if (extension.trusted) {
124
135
  tooltip = ( localize(
125
- 4383,
136
+ 4416,
126
137
  "This extension is trusted by Microsoft and\nalways has access to this account"
127
138
  ));
128
139
  disabled = true;
@@ -133,10 +144,7 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
133
144
  description,
134
145
  tooltip,
135
146
  disabled,
136
- buttons: [{
137
- tooltip: ( localize(4384, "Manage account preferences for this extension")),
138
- iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
139
- }],
147
+ buttons: [this._viewDetailsButton, this._managePreferencesButton],
140
148
  picked: extension.allowed === undefined || extension.allowed
141
149
  };
142
150
  }
@@ -145,9 +153,9 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
145
153
  const quickPick = disposableStore.add(this._quickInputService.createQuickPick({ useSeparators: true }));
146
154
  quickPick.canSelectMany = true;
147
155
  quickPick.customButton = true;
148
- quickPick.customLabel = ( localize(4385, 'Cancel'));
149
- quickPick.title = ( localize(4386, "Manage Trusted Extensions"));
150
- quickPick.placeholder = ( localize(4387, "Choose which extensions can access this account"));
156
+ quickPick.customLabel = ( localize(4417, 'Cancel'));
157
+ quickPick.title = ( localize(4418, "Manage Trusted Extensions"));
158
+ quickPick.placeholder = ( localize(4419, "Choose which extensions can access this account"));
151
159
  disposableStore.add(quickPick.onDidAccept(() => {
152
160
  const updatedAllowedList = ( quickPick.items
153
161
  .filter((item) => item.type !== 'separator')
@@ -161,7 +169,14 @@ let ManageTrustedExtensionsForAccountActionImpl = class ManageTrustedExtensionsF
161
169
  }));
162
170
  disposableStore.add(quickPick.onDidHide(() => disposableStore.dispose()));
163
171
  disposableStore.add(quickPick.onDidCustom(() => quickPick.hide()));
164
- disposableStore.add(quickPick.onDidTriggerItemButton(e => this._commandService.executeCommand('_manageAccountPreferencesForExtension', e.item.extension.id, accountQuery.providerId)));
172
+ disposableStore.add(quickPick.onDidTriggerItemButton(e => {
173
+ if (e.button === this._managePreferencesButton) {
174
+ this._commandService.executeCommand('_manageAccountPreferencesForExtension', e.item.extension.id, accountQuery.providerId);
175
+ }
176
+ else if (e.button === this._viewDetailsButton) {
177
+ this._extensionsWorkbenchService.open(e.item.extension.id);
178
+ }
179
+ }));
165
180
  return quickPick;
166
181
  }
167
182
  };
@@ -171,7 +186,8 @@ ManageTrustedExtensionsForAccountActionImpl = ( __decorate([
171
186
  ( __param(2, IQuickInputService)),
172
187
  ( __param(3, IAuthenticationService)),
173
188
  ( __param(4, IAuthenticationQueryService)),
174
- ( __param(5, ICommandService))
189
+ ( __param(5, ICommandService)),
190
+ ( __param(6, IExtensionsWorkbenchService))
175
191
  ], ManageTrustedExtensionsForAccountActionImpl));
176
192
 
177
193
  export { ManageTrustedExtensionsForAccountAction };
@@ -12,15 +12,17 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
12
12
  import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
13
13
  import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
14
14
  import { IAuthenticationQueryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authenticationQuery.service';
15
+ import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
15
16
  import { IMcpService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes.service';
16
17
 
17
18
  class ManageTrustedMcpServersForAccountAction extends Action2 {
18
19
  constructor() {
19
20
  super({
20
21
  id: '_manageTrustedMCPServersForAccount',
21
- title: ( localize2(4388, "Manage Trusted MCP Servers For Account")),
22
- category: ( localize2(4389, "Accounts")),
23
- f1: true
22
+ title: ( localize2(4420, "Manage Trusted MCP Servers For Account")),
23
+ category: ( localize2(4421, "Accounts")),
24
+ f1: true,
25
+ precondition: ( ChatContextKeys.Setup.hidden.negate())
24
26
  });
25
27
  }
26
28
  run(accessor, options) {
@@ -57,7 +59,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
57
59
  }
58
60
  const accounts = await this._getAllAvailableAccounts();
59
61
  const pick = await this._quickInputService.pick(accounts, {
60
- placeHolder: ( localize(4390, "Pick an account to manage trusted MCP servers for")),
62
+ placeHolder: ( localize(4422, "Pick an account to manage trusted MCP servers for")),
61
63
  matchOnDescription: true,
62
64
  });
63
65
  return pick ? this._authenticationQueryService.provider(pick.providerId).account(pick.label) : undefined;
@@ -95,7 +97,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
95
97
  };
96
98
  }));
97
99
  if (!filteredMcpServers.length) {
98
- this._dialogService.info(( localize(4391, "This account has not been used by any MCP servers.")));
100
+ this._dialogService.info(( localize(4423, "This account has not been used by any MCP servers.")));
99
101
  return [];
100
102
  }
101
103
  const trustedServers = filteredMcpServers.filter(s => s.trusted);
@@ -103,20 +105,20 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
103
105
  const sortByLastUsed = (a, b) => (b.lastUsed || 0) - (a.lastUsed || 0);
104
106
  return [
105
107
  ...( otherServers.sort(sortByLastUsed).map(this._toQuickPickItem)),
106
- { type: 'separator', label: ( localize(4392, "Trusted by Microsoft")) },
108
+ { type: 'separator', label: ( localize(4424, "Trusted by Microsoft")) },
107
109
  ...( trustedServers.sort(sortByLastUsed).map(this._toQuickPickItem))
108
110
  ];
109
111
  }
110
112
  _toQuickPickItem(mcpServer) {
111
113
  const lastUsed = mcpServer.lastUsed;
112
114
  const description = lastUsed
113
- ? ( localize(4393, "Last used this account {0}", fromNow(lastUsed, true)))
114
- : ( localize(4394, "Has not used this account"));
115
+ ? ( localize(4425, "Last used this account {0}", fromNow(lastUsed, true)))
116
+ : ( localize(4426, "Has not used this account"));
115
117
  let tooltip;
116
118
  let disabled;
117
119
  if (mcpServer.trusted) {
118
120
  tooltip = ( localize(
119
- 4395,
121
+ 4427,
120
122
  "This MCP server is trusted by Microsoft and\nalways has access to this account"
121
123
  ));
122
124
  disabled = true;
@@ -128,7 +130,7 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
128
130
  tooltip,
129
131
  disabled,
130
132
  buttons: [{
131
- tooltip: ( localize(4396, "Manage account preferences for this MCP server")),
133
+ tooltip: ( localize(4428, "Manage account preferences for this MCP server")),
132
134
  iconClass: ThemeIcon.asClassName(Codicon.settingsGear),
133
135
  }],
134
136
  picked: mcpServer.allowed === undefined || mcpServer.allowed
@@ -139,9 +141,9 @@ let ManageTrustedMcpServersForAccountActionImpl = class ManageTrustedMcpServersF
139
141
  const quickPick = disposableStore.add(this._quickInputService.createQuickPick({ useSeparators: true }));
140
142
  quickPick.canSelectMany = true;
141
143
  quickPick.customButton = true;
142
- quickPick.customLabel = ( localize(4397, 'Cancel'));
143
- quickPick.title = ( localize(4398, "Manage Trusted MCP Servers"));
144
- quickPick.placeholder = ( localize(4399, "Choose which MCP servers can access this account"));
144
+ quickPick.customLabel = ( localize(4429, 'Cancel'));
145
+ quickPick.title = ( localize(4430, "Manage Trusted MCP Servers"));
146
+ quickPick.placeholder = ( localize(4431, "Choose which MCP servers can access this account"));
145
147
  disposableStore.add(quickPick.onDidAccept(() => {
146
148
  quickPick.hide();
147
149
  const allServers = ( quickPick.items
@@ -11,7 +11,7 @@ class SignOutOfAccountAction extends Action2 {
11
11
  constructor() {
12
12
  super({
13
13
  id: '_signOutOfAccount',
14
- title: ( localize(4400, "Sign out of account")),
14
+ title: ( localize(4432, "Sign out of account")),
15
15
  f1: false
16
16
  });
17
17
  }
@@ -32,13 +32,13 @@ class SignOutOfAccountAction extends Action2 {
32
32
  type: Severity.Info,
33
33
  message: accountUsages.length
34
34
  ? ( localize(
35
- 4401,
35
+ 4433,
36
36
  "The account '{0}' has been used by: \n\n{1}\n\n Sign out from these extensions?",
37
37
  accountLabel,
38
38
  ( accountUsages.map(usage => usage.extensionName)).join('\n')
39
39
  ))
40
- : ( localize(4402, "Sign out of '{0}'?", accountLabel)),
41
- primaryButton: ( localize(4403, "&&Sign Out"))
40
+ : ( localize(4434, "Sign out of '{0}'?", accountLabel)),
41
+ primaryButton: ( localize(4435, "&&Sign Out"))
42
42
  });
43
43
  if (confirmed) {
44
44
  const removeSessionPromises = ( sessions.map(session => authenticationService.removeSession(providerId, session.id)));
@@ -16,12 +16,7 @@ import { IAuthenticationUsageService } from '@codingame/monaco-vscode-api/vscode
16
16
  import { ManageAccountPreferencesForMcpServerAction } from './actions/manageAccountPreferencesForMcpServerAction.js';
17
17
  import { ManageTrustedMcpServersForAccountAction } from './actions/manageTrustedMcpServersForAccountAction.js';
18
18
  import { RemoveDynamicAuthenticationProvidersAction } from './actions/manageDynamicAuthenticationProvidersAction.js';
19
- import { IAuthenticationQueryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authenticationQuery.service';
20
- import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
21
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
22
- import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
23
- import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
24
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
19
+ import { ManageAccountsAction } from './actions/manageAccountsAction.js';
25
20
 
26
21
  const codeExchangeProxyCommand = CommandsRegistry.registerCommand('workbench.getCodeExchangeProxyEndpoints', function (accessor, _) {
27
22
  const environmentService = accessor.get(IBrowserWorkbenchEnvironmentService);
@@ -41,9 +36,9 @@ class AuthenticationDataRenderer extends Disposable {
41
36
  return { data: { headers: [], rows: [] }, dispose: () => { } };
42
37
  }
43
38
  const headers = [
44
- ( localize(4404, "Label")),
45
- ( localize(4405, "ID")),
46
- ( localize(4406, "MCP Authorization Servers"))
39
+ ( localize(4436, "Label")),
40
+ ( localize(4437, "ID")),
41
+ ( localize(4438, "MCP Authorization Servers"))
47
42
  ];
48
43
  const rows = ( authentication
49
44
  .sort((a, b) => a.label.localeCompare(b.label))
@@ -65,7 +60,7 @@ class AuthenticationDataRenderer extends Disposable {
65
60
  }
66
61
  const extensionFeature = ( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
67
62
  id: 'authentication',
68
- label: ( localize(4407, "Authentication")),
63
+ label: ( localize(4439, "Authentication")),
69
64
  access: {
70
65
  canToggle: false
71
66
  },
@@ -80,6 +75,7 @@ class AuthenticationContribution extends Disposable {
80
75
  this._registerActions();
81
76
  }
82
77
  _registerActions() {
78
+ this._register(registerAction2(ManageAccountsAction));
83
79
  this._register(registerAction2(SignOutOfAccountAction));
84
80
  this._register(registerAction2(ManageTrustedExtensionsForAccountAction));
85
81
  this._register(registerAction2(ManageAccountPreferencesForExtensionAction));
@@ -101,40 +97,5 @@ let AuthenticationUsageContribution = class AuthenticationUsageContribution {
101
97
  AuthenticationUsageContribution = ( __decorate([
102
98
  ( __param(0, IAuthenticationUsageService))
103
99
  ], AuthenticationUsageContribution));
104
- let AuthenticationMcpContribution = class AuthenticationMcpContribution extends Disposable {
105
- static { this.ID = 'workbench.contrib.authenticationMcp'; }
106
- constructor(_mcpRegistry, _authenticationQueryService, _authenticationService) {
107
- super();
108
- this._mcpRegistry = _mcpRegistry;
109
- this._authenticationQueryService = _authenticationQueryService;
110
- this._authenticationService = _authenticationService;
111
- this._cleanupRemovedMcpServers();
112
- this._register(autorun(reader => {
113
- this._mcpRegistry.collections.read(reader);
114
- queueMicrotask(() => this._cleanupRemovedMcpServers());
115
- }));
116
- this._register(Event.any(this._authenticationService.onDidChangeDeclaredProviders, this._authenticationService.onDidRegisterAuthenticationProvider)(() => this._cleanupRemovedMcpServers()));
117
- }
118
- _cleanupRemovedMcpServers() {
119
- const currentServerIds = ( new Set(( this._mcpRegistry.collections.get().flatMap(c => c.serverDefinitions.get()).map(s => s.id))));
120
- const providerIds = this._authenticationQueryService.getProviderIds();
121
- for (const providerId of providerIds) {
122
- this._authenticationQueryService.provider(providerId).forEachAccount(account => {
123
- account.mcpServers().forEach(server => {
124
- if (!( currentServerIds.has(server.mcpServerId))) {
125
- server.removeUsage();
126
- server.setAccessAllowed(false);
127
- }
128
- });
129
- });
130
- }
131
- }
132
- };
133
- AuthenticationMcpContribution = ( __decorate([
134
- ( __param(0, IMcpRegistry)),
135
- ( __param(1, IAuthenticationQueryService)),
136
- ( __param(2, IAuthenticationService))
137
- ], AuthenticationMcpContribution));
138
100
  registerWorkbenchContribution2(AuthenticationContribution.ID, AuthenticationContribution, WorkbenchPhase.AfterRestored);
139
101
  registerWorkbenchContribution2(AuthenticationUsageContribution.ID, AuthenticationUsageContribution, WorkbenchPhase.Eventually);
140
- registerWorkbenchContribution2(AuthenticationMcpContribution.ID, AuthenticationMcpContribution, WorkbenchPhase.Eventually);
@@ -11,7 +11,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/noti
11
11
  import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
12
12
  import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
13
13
  import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
14
- import { NumberBadge } from '@codingame/monaco-vscode-d941ac7b-412f-57e3-b1bf-f6b0eb253b21-common/vscode/vs/workbench/services/activity/common/activity';
14
+ import { NumberBadge } from '@codingame/monaco-vscode-3b5a5cd1-d4ff-500a-b609-57e0cd4afa0a-common/vscode/vs/workbench/services/activity/common/activity';
15
15
  import { IActivityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/activity/common/activity.service';
16
16
  import { IAuthenticationAccessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationAccessService.service';
17
17
  import { IAuthenticationUsageService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/browser/authenticationUsageService.service';
@@ -113,7 +113,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
113
113
  numberOfRequests += ( Object.keys(accessRequest)).length;
114
114
  });
115
115
  if (numberOfRequests > 0) {
116
- const badge = ( new NumberBadge(numberOfRequests, () => ( localize(13182, "Sign in requested"))));
116
+ const badge = ( new NumberBadge(numberOfRequests, () => ( localize(13496, "Sign in requested"))));
117
117
  this._accountBadgeDisposable.value = this.activityService.showAccountsActivity({ badge });
118
118
  }
119
119
  }
@@ -180,7 +180,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
180
180
  const { result } = await this.dialogService.prompt({
181
181
  type: Severity.Info,
182
182
  message: ( localize(
183
- 13183,
183
+ 13497,
184
184
  "The extension '{0}' wants to access the {1} account '{2}'.",
185
185
  extensionName,
186
186
  provider.label,
@@ -188,11 +188,11 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
188
188
  )),
189
189
  buttons: [
190
190
  {
191
- label: ( localize(13184, "&&Allow")),
191
+ label: ( localize(13498, "&&Allow")),
192
192
  run: () => SessionPromptChoice.Allow
193
193
  },
194
194
  {
195
- label: ( localize(13185, "&&Deny")),
195
+ label: ( localize(13499, "&&Deny")),
196
196
  run: () => SessionPromptChoice.Deny
197
197
  }
198
198
  ],
@@ -228,16 +228,16 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
228
228
  items.push({ label: account.label, account });
229
229
  }
230
230
  });
231
- items.push({ label: ( localize(13186, "Sign in to another account")) });
231
+ items.push({ label: ( localize(13500, "Sign in to another account")) });
232
232
  quickPick.items = items;
233
233
  quickPick.title = ( localize(
234
- 13187,
234
+ 13501,
235
235
  "The extension '{0}' wants to access a {1} account",
236
236
  extensionName,
237
237
  this._authenticationService.getProvider(providerId).label
238
238
  ));
239
239
  quickPick.placeholder = ( localize(
240
- 13188,
240
+ 13502,
241
241
  "Select an account for '{0}' to use or Esc to cancel",
242
242
  extensionName
243
243
  ));
@@ -309,7 +309,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
309
309
  group: '3_accessRequests',
310
310
  command: {
311
311
  id: `${providerId}${extensionId}Access`,
312
- title: ( localize(13189, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
312
+ title: ( localize(13503, "Grant access to {0} for {1}... (1)", provider.label, extensionName))
313
313
  }
314
314
  }));
315
315
  const accessCommand = CommandsRegistry.registerCommand({
@@ -355,7 +355,7 @@ let AuthenticationExtensionsService = class AuthenticationExtensionsService exte
355
355
  group: '2_signInRequests',
356
356
  command: {
357
357
  id: commandId,
358
- title: ( localize(13190, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
358
+ title: ( localize(13504, "Sign in with {0} to use {1} (1)", provider.label, extensionName))
359
359
  }
360
360
  }));
361
361
  const signInCommand = CommandsRegistry.registerCommand({