@codingame/monaco-vscode-extensions-service-override 36.2.6 → 37.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 +3 -3
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +29 -29
- package/vscode/src/vs/platform/telemetry/common/assignmentContext.d.ts +4 -0
- package/vscode/src/vs/platform/telemetry/common/assignmentContext.js +13 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +14 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +9 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +56 -39
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +6 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +5 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +7 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +8 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +17 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +130 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +2 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +2 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +8 -12
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +9 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +11 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +20 -20
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +1 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +42 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +42 -23
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +2 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +19 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +14 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +12 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +5 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +5 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.js +39 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +23 -23
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +2 -2
- package/vscode/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.js +6 -5
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +12 -12
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-extensions-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - extensions service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "37.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -13,9 +13,9 @@ import { getIdAndVersion, areSameExtensions, getGalleryExtensionId, getExtension
|
|
|
13
13
|
import { ExtensionType, EXTENSION_CATEGORIES } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
14
14
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
15
15
|
|
|
16
|
-
const notFound = id => ( localize(
|
|
16
|
+
const notFound = id => ( localize(2198, "Extension '{0}' not found.", id));
|
|
17
17
|
const useId = ( localize(
|
|
18
|
-
|
|
18
|
+
2199,
|
|
19
19
|
"Make sure you use the full extension ID, including the publisher, e.g.: {0}",
|
|
20
20
|
"ms-dotnettools.csharp"
|
|
21
21
|
));
|
|
@@ -62,7 +62,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
if (this.location) {
|
|
65
|
-
this.logger.info(( localize(
|
|
65
|
+
this.logger.info(( localize(2200, "Extensions installed on {0}:", this.location)));
|
|
66
66
|
}
|
|
67
67
|
extensions = extensions.sort((e1, e2) => e1.identifier.id.localeCompare(e2.identifier.id));
|
|
68
68
|
let lastId = undefined;
|
|
@@ -77,7 +77,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
77
77
|
const failed = [];
|
|
78
78
|
try {
|
|
79
79
|
if (extensions.length) {
|
|
80
|
-
this.logger.info(this.location ? ( localize(
|
|
80
|
+
this.logger.info(this.location ? ( localize(2201, "Installing extensions on {0}...", this.location)) : ( localize(2202, "Installing extensions...")));
|
|
81
81
|
}
|
|
82
82
|
const installVSIXInfos = [];
|
|
83
83
|
const installExtensionInfos = [];
|
|
@@ -142,11 +142,11 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
142
142
|
failed.push(...failedGalleryExtensions);
|
|
143
143
|
}
|
|
144
144
|
} catch (error) {
|
|
145
|
-
this.logger.error(( localize(
|
|
145
|
+
this.logger.error(( localize(2203, "Error while installing extensions: {0}", getErrorMessage(error))));
|
|
146
146
|
throw error;
|
|
147
147
|
}
|
|
148
148
|
if (failed.length) {
|
|
149
|
-
throw ( new Error(( localize(
|
|
149
|
+
throw ( new Error(( localize(2204, "Failed Installing Extensions: {0}", failed.join(", ")))));
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
async updateExtensions(profileLocation) {
|
|
@@ -161,7 +161,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
this.logger.trace(( localize(
|
|
164
|
-
|
|
164
|
+
2205,
|
|
165
165
|
"Fetching latest versions for {0} extensions",
|
|
166
166
|
installedExtensionsQuery.length
|
|
167
167
|
)));
|
|
@@ -185,11 +185,11 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
if (!extensionsToUpdate.length) {
|
|
188
|
-
this.logger.info(( localize(
|
|
188
|
+
this.logger.info(( localize(2206, "No extension to update")));
|
|
189
189
|
return;
|
|
190
190
|
}
|
|
191
191
|
this.logger.info(( localize(
|
|
192
|
-
|
|
192
|
+
2207,
|
|
193
193
|
"Updating extensions: {0}",
|
|
194
194
|
( extensionsToUpdate.map(ext => ext.extension.identifier.id)).join(", ")
|
|
195
195
|
)));
|
|
@@ -197,14 +197,14 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
197
197
|
for (const extensionResult of installationResult) {
|
|
198
198
|
if (extensionResult.error) {
|
|
199
199
|
this.logger.error(( localize(
|
|
200
|
-
|
|
200
|
+
2208,
|
|
201
201
|
"Error while updating extension {0}: {1}",
|
|
202
202
|
extensionResult.identifier.id,
|
|
203
203
|
getErrorMessage(extensionResult.error)
|
|
204
204
|
)));
|
|
205
205
|
} else {
|
|
206
206
|
this.logger.info(( localize(
|
|
207
|
-
|
|
207
|
+
2209,
|
|
208
208
|
"Extension '{0}' v{1} was successfully updated.",
|
|
209
209
|
extensionResult.identifier.id,
|
|
210
210
|
extensionResult.local?.manifest.version
|
|
@@ -230,7 +230,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
230
230
|
}
|
|
231
231
|
if (!force && (!version || (version === "prerelease" && installedExtension.preRelease))) {
|
|
232
232
|
this.logger.info(( localize(
|
|
233
|
-
|
|
233
|
+
2210,
|
|
234
234
|
"Extension '{0}' v{1} is already installed. Use '--force' option to update to latest version or provide '@<version>' to install a specific version, for example: '{2}@1.2.3'.",
|
|
235
235
|
id,
|
|
236
236
|
installedExtension.manifest.version,
|
|
@@ -239,7 +239,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
239
239
|
return false;
|
|
240
240
|
}
|
|
241
241
|
if (version && installedExtension.manifest.version === version) {
|
|
242
|
-
this.logger.info(( localize(
|
|
242
|
+
this.logger.info(( localize(2211, "Extension '{0}' is already installed.", `${id}@${version}`)));
|
|
243
243
|
return false;
|
|
244
244
|
}
|
|
245
245
|
if (installedExtension.preRelease && version !== "prerelease") {
|
|
@@ -281,23 +281,23 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
281
281
|
if (installedExtension) {
|
|
282
282
|
if (gallery.version === installedExtension.manifest.version) {
|
|
283
283
|
this.logger.info(( localize(
|
|
284
|
-
|
|
284
|
+
2211,
|
|
285
285
|
"Extension '{0}' is already installed.",
|
|
286
286
|
version ? `${id}@${version}` : id
|
|
287
287
|
)));
|
|
288
288
|
return;
|
|
289
289
|
}
|
|
290
290
|
this.logger.info(( localize(
|
|
291
|
-
|
|
291
|
+
2212,
|
|
292
292
|
"Updating the extension '{0}' to the version {1}",
|
|
293
293
|
id,
|
|
294
294
|
gallery.version
|
|
295
295
|
)));
|
|
296
296
|
}
|
|
297
297
|
if (installOptions.isBuiltin) {
|
|
298
|
-
this.logger.info(version ? ( localize(
|
|
298
|
+
this.logger.info(version ? ( localize(2213, "Installing builtin extension '{0}' v{1}...", id, version)) : ( localize(2214, "Installing builtin extension '{0}'...", id)));
|
|
299
299
|
} else {
|
|
300
|
-
this.logger.info(version ? ( localize(
|
|
300
|
+
this.logger.info(version ? ( localize(2215, "Installing extension '{0}' v{1}...", id, version)) : ( localize(2216, "Installing extension '{0}'...", id)));
|
|
301
301
|
}
|
|
302
302
|
extensionsToInstall.push({
|
|
303
303
|
extension: gallery,
|
|
@@ -313,7 +313,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
313
313
|
for (const extensionResult of installationResult) {
|
|
314
314
|
if (extensionResult.error) {
|
|
315
315
|
this.logger.error(( localize(
|
|
316
|
-
|
|
316
|
+
2217,
|
|
317
317
|
"Error while installing extension {0}: {1}",
|
|
318
318
|
extensionResult.identifier.id,
|
|
319
319
|
getErrorMessage(extensionResult.error)
|
|
@@ -321,7 +321,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
321
321
|
failed.push(extensionResult.identifier.id);
|
|
322
322
|
} else {
|
|
323
323
|
this.logger.info(( localize(
|
|
324
|
-
|
|
324
|
+
2218,
|
|
325
325
|
"Extension '{0}' v{1} was successfully installed.",
|
|
326
326
|
extensionResult.identifier.id,
|
|
327
327
|
extensionResult.local?.manifest.version
|
|
@@ -343,10 +343,10 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
343
343
|
...installOptions,
|
|
344
344
|
installGivenVersion: true
|
|
345
345
|
});
|
|
346
|
-
this.logger.info(( localize(
|
|
346
|
+
this.logger.info(( localize(2219, "Extension '{0}' was successfully installed.", basename(vsix))));
|
|
347
347
|
} catch (error) {
|
|
348
348
|
if (isCancellationError(error)) {
|
|
349
|
-
this.logger.info(( localize(
|
|
349
|
+
this.logger.info(( localize(2220, "Cancelled installing extension '{0}'.", basename(vsix))));
|
|
350
350
|
} else {
|
|
351
351
|
throw error;
|
|
352
352
|
}
|
|
@@ -393,7 +393,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
393
393
|
if (!force) {
|
|
394
394
|
if (semverExports.gt(existingExtension.manifest.version, manifest.version)) {
|
|
395
395
|
this.logger.info(( localize(
|
|
396
|
-
|
|
396
|
+
2221,
|
|
397
397
|
"A newer version of extension '{0}' v{1} is already installed. Use '--force' option to downgrade to older version.",
|
|
398
398
|
existingExtension.identifier.id,
|
|
399
399
|
existingExtension.manifest.version,
|
|
@@ -424,7 +424,7 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
424
424
|
}
|
|
425
425
|
if (( extensionsToUninstall.some(e => e.type === ExtensionType.System))) {
|
|
426
426
|
this.logger.info(( localize(
|
|
427
|
-
|
|
427
|
+
2222,
|
|
428
428
|
"Extension '{0}' is a Built-in extension and cannot be uninstalled",
|
|
429
429
|
id
|
|
430
430
|
)));
|
|
@@ -432,13 +432,13 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
432
432
|
}
|
|
433
433
|
if (!force && ( extensionsToUninstall.some(e => e.isBuiltin))) {
|
|
434
434
|
this.logger.info(( localize(
|
|
435
|
-
|
|
435
|
+
2223,
|
|
436
436
|
"Extension '{0}' is marked as a Built-in extension by user. Please use '--force' option to uninstall it.",
|
|
437
437
|
id
|
|
438
438
|
)));
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
|
-
this.logger.info(( localize(
|
|
441
|
+
this.logger.info(( localize(2224, "Uninstalling {0}...", id)));
|
|
442
442
|
for (const extensionToUninstall of extensionsToUninstall) {
|
|
443
443
|
await this.extensionManagementService.uninstall(extensionToUninstall, {
|
|
444
444
|
profileLocation
|
|
@@ -446,13 +446,13 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
446
446
|
}
|
|
447
447
|
if (this.location) {
|
|
448
448
|
this.logger.info(( localize(
|
|
449
|
-
|
|
449
|
+
2225,
|
|
450
450
|
"Extension '{0}' was successfully uninstalled from {1}!",
|
|
451
451
|
id,
|
|
452
452
|
this.location
|
|
453
453
|
)));
|
|
454
454
|
} else {
|
|
455
|
-
this.logger.info(( localize(
|
|
455
|
+
this.logger.info(( localize(2226, "Extension '{0}' was successfully uninstalled!", id)));
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
}
|
|
@@ -470,12 +470,12 @@ let ExtensionManagementCLI = class ExtensionManagementCLI {
|
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
notInstalled(id) {
|
|
473
|
-
return this.location ? ( localize(
|
|
473
|
+
return this.location ? ( localize(2227, "Extension '{0}' is not installed on {1}.", id, this.location)) : ( localize(2228, "Extension '{0}' is not installed.", id));
|
|
474
474
|
}
|
|
475
475
|
validateBuiltinExtensionEnabledWithAutoUpdates(extension) {
|
|
476
476
|
if (extension.isBuiltin && ( this.productService.builtInExtensionsEnabledWithAutoUpdates.some(e => e.toLowerCase() === extension.identifier.id.toLowerCase())) && !extension.forceAutoUpdate) {
|
|
477
477
|
return localize(
|
|
478
|
-
|
|
478
|
+
2229,
|
|
479
479
|
"Extension '{0}' is a built-in extension and not allowed to be updated in the current product quality '{1}'.",
|
|
480
480
|
extension.identifier.id,
|
|
481
481
|
this.productService.quality
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
const MAX_ASSIGNMENT_CONTEXT_LENGTH = 8 * 1024;
|
|
4
|
+
const ASSIGNMENT_CONTEXT_ENTRY_PATTERN = /^[^:;\s\x00-\x1F\x7F]+:[^;\x00-\x1F\x7F]+$/;
|
|
5
|
+
function isValidAssignmentContext(value) {
|
|
6
|
+
if (value.length === 0 || value.length > MAX_ASSIGNMENT_CONTEXT_LENGTH) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const entries = value.endsWith(';') ? value.slice(0, -1).split(';') : value.split(';');
|
|
10
|
+
return entries.length > 0 && entries.every(entry => ASSIGNMENT_CONTEXT_ENTRY_PATTERN.test(entry));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { isValidAssignmentContext };
|
|
@@ -19,6 +19,7 @@ export declare class MainThreadAgentEditorComments implements MainThreadAgentEdi
|
|
|
19
19
|
constructor(extHostContext: IExtHostContext, _bridge: IAgentEditorCommentsBridge);
|
|
20
20
|
$createAgentEditorComments(handle: number, uri: UriComponents): Promise<void>;
|
|
21
21
|
$addComment(handle: number, range: IRange, body: string): Promise<void>;
|
|
22
|
+
$deleteComment(handle: number, id: string): Promise<void>;
|
|
22
23
|
$disposeAgentEditorComments(handle: number): Promise<void>;
|
|
23
24
|
private _sendComments;
|
|
24
25
|
dispose(): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { DisposableMap, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
4
5
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
5
6
|
import { IAgentEditorCommentsBridge } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentEditorComments/common/agentEditorComments.service';
|
|
6
7
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
@@ -18,6 +19,11 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
|
|
|
18
19
|
this._resources.set(handle, resource);
|
|
19
20
|
const store = ( new DisposableStore());
|
|
20
21
|
store.add(this._bridge.onDidChangeComments(() => this._sendComments(handle)));
|
|
22
|
+
store.add(this._bridge.onDidRevealComment(event => {
|
|
23
|
+
if (isEqual(event.resource, resource)) {
|
|
24
|
+
this._proxy.$revealAgentEditorComment(handle, event.id);
|
|
25
|
+
}
|
|
26
|
+
}));
|
|
21
27
|
this._disposables.set(handle, store);
|
|
22
28
|
this._sendComments(handle);
|
|
23
29
|
}
|
|
@@ -28,6 +34,13 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
|
|
|
28
34
|
}
|
|
29
35
|
this._bridge.addComment(resource, range, body);
|
|
30
36
|
}
|
|
37
|
+
async $deleteComment(handle, id) {
|
|
38
|
+
const resource = this._resources.get(handle);
|
|
39
|
+
if (!resource) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this._bridge.deleteComment(resource, id);
|
|
43
|
+
}
|
|
31
44
|
async $disposeAgentEditorComments(handle) {
|
|
32
45
|
this._resources.delete(handle);
|
|
33
46
|
this._disposables.deleteAndDispose(handle);
|
|
@@ -42,7 +55,7 @@ let MainThreadAgentEditorComments = class MainThreadAgentEditorComments {
|
|
|
42
55
|
range: comment.range,
|
|
43
56
|
body: comment.body
|
|
44
57
|
})));
|
|
45
|
-
this._proxy.$acceptAgentEditorComments(handle, comments);
|
|
58
|
+
this._proxy.$acceptAgentEditorComments(handle, comments, this._bridge.acceptsComments(resource));
|
|
46
59
|
}
|
|
47
60
|
dispose() {
|
|
48
61
|
this._disposables.dispose();
|
|
@@ -13,6 +13,7 @@ import { IAuthenticationUsageService } from "@codingame/monaco-vscode-api/vscode
|
|
|
13
13
|
import { UriComponents } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
14
14
|
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
15
15
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
16
|
+
import { Dto } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/proxyIdentifier";
|
|
16
17
|
import { IURLService } from "@codingame/monaco-vscode-api/vscode/vs/platform/url/common/url.service";
|
|
17
18
|
import { IAuthorizationTokenResponse } from "@codingame/monaco-vscode-api/vscode/vs/base/common/oauth";
|
|
18
19
|
import { IDynamicAuthenticationProviderStorageService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/dynamicAuthenticationProviderStorage.service";
|
|
@@ -34,6 +35,11 @@ export interface AuthenticationGetSessionOptions {
|
|
|
34
35
|
account?: AuthenticationSessionAccount;
|
|
35
36
|
authorizationServer?: UriComponents;
|
|
36
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The account icon is a {@link URI} that does not survive being sent over the RPC boundary,
|
|
40
|
+
* so it needs to be revived when sessions are received from the extension host.
|
|
41
|
+
*/
|
|
42
|
+
export declare function reviveSessionAccountIcon(session: Dto<AuthenticationSession>): AuthenticationSession;
|
|
37
43
|
export declare class MainThreadAuthentication extends Disposable implements MainThreadAuthenticationShape {
|
|
38
44
|
private readonly productService;
|
|
39
45
|
private readonly authenticationService;
|
|
@@ -60,7 +66,7 @@ export declare class MainThreadAuthentication extends Disposable implements Main
|
|
|
60
66
|
$registerAuthenticationProvider({ id, label, supportsMultipleAccounts, resourceServer, supportedAuthorizationServers, supportsChallenges }: IRegisterAuthenticationProviderDetails): Promise<void>;
|
|
61
67
|
$unregisterAuthenticationProvider(id: string): Promise<void>;
|
|
62
68
|
$ensureProvider(id: string): Promise<void>;
|
|
63
|
-
$sendDidChangeSessions(providerId: string, event: AuthenticationSessionsChangeEvent): Promise<void>;
|
|
69
|
+
$sendDidChangeSessions(providerId: string, event: Dto<AuthenticationSessionsChangeEvent>): Promise<void>;
|
|
64
70
|
$removeSession(providerId: string, sessionId: string): Promise<void>;
|
|
65
71
|
$waitForUriHandler(expectedUri: UriComponents): Promise<UriComponents>;
|
|
66
72
|
$showContinueNotification(message: string): Promise<boolean>;
|
|
@@ -78,8 +84,8 @@ export declare class MainThreadAuthentication extends Disposable implements Main
|
|
|
78
84
|
private loginPrompt;
|
|
79
85
|
private continueWithIncorrectAccountPrompt;
|
|
80
86
|
private doGetSession;
|
|
81
|
-
$getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | IAuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<AuthenticationSession | undefined>;
|
|
82
|
-
$getAccounts(providerId: string): Promise<ReadonlyArray<AuthenticationSessionAccount
|
|
87
|
+
$getSession(providerId: string, scopeListOrRequest: ReadonlyArray<string> | IAuthenticationWwwAuthenticateRequest, extensionId: string, extensionName: string, options: AuthenticationGetSessionOptions): Promise<Dto<AuthenticationSession> | undefined>;
|
|
88
|
+
$getAccounts(providerId: string): Promise<ReadonlyArray<Dto<AuthenticationSessionAccount>>>;
|
|
83
89
|
private _sentClientIdUsageEvents;
|
|
84
90
|
private sendClientIdUsageTelemetry;
|
|
85
91
|
private sendProviderUsageTelemetry;
|
|
@@ -3,7 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
5
|
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
6
|
-
import { isAuthenticationWwwAuthenticateRequest } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication';
|
|
6
|
+
import { getDynamicAuthenticationProviderId, isAuthenticationWwwAuthenticateRequest } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication';
|
|
7
7
|
import { IAuthenticationService, IAuthenticationExtensionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
8
8
|
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
9
9
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
@@ -33,6 +33,15 @@ import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
33
33
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
34
34
|
import { mcpEnterpriseManagedAuthIdpSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpConfiguration';
|
|
35
35
|
|
|
36
|
+
function reviveSessionAccountIcon(session) {
|
|
37
|
+
return {
|
|
38
|
+
...session,
|
|
39
|
+
account: {
|
|
40
|
+
...session.account,
|
|
41
|
+
icon: URI.revive(session.account.icon)
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
36
45
|
class MainThreadAuthenticationProvider extends Disposable {
|
|
37
46
|
constructor(
|
|
38
47
|
_proxy,
|
|
@@ -53,10 +62,11 @@ class MainThreadAuthenticationProvider extends Disposable {
|
|
|
53
62
|
this.onDidChangeSessions = onDidChangeSessionsEmitter.event;
|
|
54
63
|
}
|
|
55
64
|
async getSessions(scopes, options) {
|
|
56
|
-
|
|
65
|
+
const sessions = await this._proxy.$getSessions(this.id, scopes, options);
|
|
66
|
+
return ( sessions.map(reviveSessionAccountIcon));
|
|
57
67
|
}
|
|
58
|
-
createSession(scopes, options) {
|
|
59
|
-
return this._proxy.$createSession(this.id, scopes, options);
|
|
68
|
+
async createSession(scopes, options) {
|
|
69
|
+
return reviveSessionAccountIcon(await this._proxy.$createSession(this.id, scopes, options));
|
|
60
70
|
}
|
|
61
71
|
async removeSession(sessionId) {
|
|
62
72
|
await this._proxy.$removeSession(this.id, sessionId);
|
|
@@ -82,11 +92,14 @@ class MainThreadAuthenticationProviderWithChallenges extends MainThreadAuthentic
|
|
|
82
92
|
onDidChangeSessionsEmitter
|
|
83
93
|
);
|
|
84
94
|
}
|
|
85
|
-
getSessionsFromChallenges(constraint, options) {
|
|
86
|
-
|
|
95
|
+
async getSessionsFromChallenges(constraint, options) {
|
|
96
|
+
const sessions = await this._proxy.$getSessionsFromChallenges(this.id, constraint, options);
|
|
97
|
+
return ( sessions.map(reviveSessionAccountIcon));
|
|
87
98
|
}
|
|
88
|
-
createSessionFromChallenges(constraint, options) {
|
|
89
|
-
return
|
|
99
|
+
async createSessionFromChallenges(constraint, options) {
|
|
100
|
+
return reviveSessionAccountIcon(
|
|
101
|
+
await this._proxy.$createSessionFromChallenges(this.id, constraint, options)
|
|
102
|
+
);
|
|
90
103
|
}
|
|
91
104
|
}
|
|
92
105
|
let MainThreadAuthentication = class MainThreadAuthentication extends Disposable {
|
|
@@ -157,7 +170,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
157
170
|
overrideClientId,
|
|
158
171
|
overrideClientSecret
|
|
159
172
|
) => {
|
|
160
|
-
const authProviderId =
|
|
173
|
+
const authProviderId = getDynamicAuthenticationProviderId(authorizationServer, resource);
|
|
161
174
|
const clientDetails = await this.dynamicAuthProviderStorageService.getClientRegistration(authProviderId);
|
|
162
175
|
let clientId = overrideClientId ?? clientDetails?.clientId;
|
|
163
176
|
const clientSecret = overrideClientId ? overrideClientSecret : (overrideClientSecret ?? clientDetails?.clientSecret);
|
|
@@ -252,7 +265,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
252
265
|
async $sendDidChangeSessions(providerId, event) {
|
|
253
266
|
const obj = this._registrations.get(providerId);
|
|
254
267
|
if (obj instanceof Emitter) {
|
|
255
|
-
obj.fire(
|
|
268
|
+
obj.fire({
|
|
269
|
+
added: event.added?.map(reviveSessionAccountIcon),
|
|
270
|
+
removed: event.removed?.map(reviveSessionAccountIcon),
|
|
271
|
+
changed: event.changed?.map(reviveSessionAccountIcon)
|
|
272
|
+
});
|
|
256
273
|
}
|
|
257
274
|
}
|
|
258
275
|
$removeSession(providerId, sessionId) {
|
|
@@ -277,8 +294,8 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
277
294
|
return await deferredPromise.p;
|
|
278
295
|
}
|
|
279
296
|
$showContinueNotification(message) {
|
|
280
|
-
const yes = ( localize(
|
|
281
|
-
const no = ( localize(
|
|
297
|
+
const yes = ( localize(2898, "Yes"));
|
|
298
|
+
const no = ( localize(2899, "No"));
|
|
282
299
|
const deferredPromise = ( new DeferredPromise());
|
|
283
300
|
let result = false;
|
|
284
301
|
const handle = this.notificationService.prompt(Severity.Warning, message, [{
|
|
@@ -334,26 +351,26 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
334
351
|
message = customMessage;
|
|
335
352
|
} else {
|
|
336
353
|
message = recreatingSession ? ( localize(
|
|
337
|
-
|
|
354
|
+
2900,
|
|
338
355
|
"The extension '{0}' wants you to sign in again using {1}.",
|
|
339
356
|
extensionName,
|
|
340
357
|
provider.label
|
|
341
358
|
)) : ( localize(
|
|
342
|
-
|
|
359
|
+
2901,
|
|
343
360
|
"The extension '{0}' wants to sign in using {1}.",
|
|
344
361
|
extensionName,
|
|
345
362
|
provider.label
|
|
346
363
|
));
|
|
347
364
|
}
|
|
348
365
|
const buttons = [{
|
|
349
|
-
label: ( localize(
|
|
366
|
+
label: ( localize(2902, "&&Allow")),
|
|
350
367
|
run() {
|
|
351
368
|
return true;
|
|
352
369
|
}
|
|
353
370
|
}];
|
|
354
371
|
if (options?.learnMore) {
|
|
355
372
|
buttons.push({
|
|
356
|
-
label: ( localize(
|
|
373
|
+
label: ( localize(2903, "Learn more")),
|
|
357
374
|
run: async () => {
|
|
358
375
|
const result = this.loginPrompt(provider, extensionName, recreatingSession, options);
|
|
359
376
|
await this.openerService.open(URI.revive(options.learnMore), {
|
|
@@ -376,9 +393,9 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
376
393
|
}
|
|
377
394
|
async continueWithIncorrectAccountPrompt(chosenAccountLabel, requestedAccountLabel) {
|
|
378
395
|
const result = await this.dialogService.prompt({
|
|
379
|
-
message: ( localize(
|
|
396
|
+
message: ( localize(2904, "Incorrect account detected")),
|
|
380
397
|
detail: ( localize(
|
|
381
|
-
|
|
398
|
+
2905,
|
|
382
399
|
"The chosen account, {0}, does not match the requested account, {1}.",
|
|
383
400
|
chosenAccountLabel,
|
|
384
401
|
requestedAccountLabel
|
|
@@ -386,10 +403,10 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
386
403
|
type: Severity.Warning,
|
|
387
404
|
cancelButton: true,
|
|
388
405
|
buttons: [{
|
|
389
|
-
label: ( localize(
|
|
406
|
+
label: ( localize(2906, "Keep {0}", chosenAccountLabel)),
|
|
390
407
|
run: () => chosenAccountLabel
|
|
391
408
|
}, {
|
|
392
|
-
label: ( localize(
|
|
409
|
+
label: ( localize(2907, "Login with {0}", requestedAccountLabel)),
|
|
393
410
|
run: () => requestedAccountLabel
|
|
394
411
|
}]
|
|
395
412
|
});
|
|
@@ -542,15 +559,15 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
542
559
|
result
|
|
543
560
|
} = await this.dialogService.prompt({
|
|
544
561
|
type: Severity.Info,
|
|
545
|
-
message: ( localize(
|
|
562
|
+
message: ( localize(2908, "Device Code Authentication")),
|
|
546
563
|
detail: ( localize(
|
|
547
|
-
|
|
564
|
+
2909,
|
|
548
565
|
"Your code: {0}\n\nTo complete authentication, navigate to {1} and enter the code above.",
|
|
549
566
|
userCode,
|
|
550
567
|
verificationUri
|
|
551
568
|
)),
|
|
552
569
|
buttons: [{
|
|
553
|
-
label: ( localize(
|
|
570
|
+
label: ( localize(2910, "Copy & Continue")),
|
|
554
571
|
run: () => true
|
|
555
572
|
}],
|
|
556
573
|
cancelButton: true
|
|
@@ -560,7 +577,7 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
560
577
|
await this.clipboardService.writeText(userCode);
|
|
561
578
|
return await this.openerService.open(( URI.parse(verificationUri)));
|
|
562
579
|
} catch (error) {
|
|
563
|
-
this.notificationService.error(( localize(
|
|
580
|
+
this.notificationService.error(( localize(2911, "Failed to open {0}", verificationUri)));
|
|
564
581
|
}
|
|
565
582
|
}
|
|
566
583
|
return false;
|
|
@@ -569,44 +586,44 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
569
586
|
const redirectUrls = "http://127.0.0.1:33418\nhttps://vscode.dev/redirect";
|
|
570
587
|
const result = await this.dialogService.prompt({
|
|
571
588
|
type: Severity.Info,
|
|
572
|
-
message: ( localize(
|
|
589
|
+
message: ( localize(2912, "Dynamic Client Registration not supported")),
|
|
573
590
|
detail: ( localize(
|
|
574
|
-
|
|
591
|
+
2913,
|
|
575
592
|
"The authorization server '{0}' does not support automatic client registration. Do you want to proceed by manually providing a client registration (client ID)?\n\nNote: When registering your OAuth application, make sure to include these redirect URIs:\n{1}",
|
|
576
593
|
authorizationServerUrl,
|
|
577
594
|
redirectUrls
|
|
578
595
|
)),
|
|
579
596
|
buttons: [{
|
|
580
|
-
label: ( localize(
|
|
597
|
+
label: ( localize(2914, "Copy URIs & Proceed")),
|
|
581
598
|
run: async () => {
|
|
582
599
|
try {
|
|
583
600
|
await this.clipboardService.writeText(redirectUrls);
|
|
584
601
|
} catch (error) {
|
|
585
|
-
this.notificationService.error(( localize(
|
|
602
|
+
this.notificationService.error(( localize(2915, "Failed to copy redirect URIs to clipboard.")));
|
|
586
603
|
}
|
|
587
604
|
return true;
|
|
588
605
|
}
|
|
589
606
|
}],
|
|
590
607
|
cancelButton: {
|
|
591
|
-
label: ( localize(
|
|
608
|
+
label: ( localize(2916, "Cancel")),
|
|
592
609
|
run: () => false
|
|
593
610
|
}
|
|
594
611
|
});
|
|
595
612
|
if (!result) {
|
|
596
613
|
return undefined;
|
|
597
614
|
}
|
|
598
|
-
const sharedTitle = ( localize(
|
|
615
|
+
const sharedTitle = ( localize(2917, "Add Client Registration Details"));
|
|
599
616
|
const clientId = await this.quickInputService.input({
|
|
600
617
|
title: sharedTitle,
|
|
601
618
|
prompt: ( localize(
|
|
602
|
-
|
|
619
|
+
2918,
|
|
603
620
|
"Enter an existing client ID that has been registered with the following redirect URIs: http://127.0.0.1:33418, https://vscode.dev/redirect"
|
|
604
621
|
)),
|
|
605
|
-
placeHolder: ( localize(
|
|
622
|
+
placeHolder: ( localize(2919, "OAuth client ID (azye39d...)")),
|
|
606
623
|
ignoreFocusLost: true,
|
|
607
624
|
validateInput: async value => {
|
|
608
625
|
if (!value || value.trim().length === 0) {
|
|
609
|
-
return localize(
|
|
626
|
+
return localize(2920, "Client ID is required");
|
|
610
627
|
}
|
|
611
628
|
return undefined;
|
|
612
629
|
}
|
|
@@ -617,11 +634,11 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
617
634
|
const clientSecret = await this.quickInputService.input({
|
|
618
635
|
title: sharedTitle,
|
|
619
636
|
prompt: ( localize(
|
|
620
|
-
|
|
637
|
+
2921,
|
|
621
638
|
"(optional) Enter an existing client secret associated with the client id '{0}' or leave this field blank",
|
|
622
639
|
clientId
|
|
623
640
|
)),
|
|
624
|
-
placeHolder: ( localize(
|
|
641
|
+
placeHolder: ( localize(2922, "OAuth client secret (wer32o50f...) or leave it blank")),
|
|
625
642
|
password: true,
|
|
626
643
|
ignoreFocusLost: true
|
|
627
644
|
});
|
|
@@ -632,14 +649,14 @@ let MainThreadAuthentication = class MainThreadAuthentication extends Disposable
|
|
|
632
649
|
}
|
|
633
650
|
async $promptForResourceClientSecret(resourceClientId, resource) {
|
|
634
651
|
const value = await this.quickInputService.input({
|
|
635
|
-
title: ( localize(
|
|
652
|
+
title: ( localize(2923, "Resource Client Secret Required")),
|
|
636
653
|
prompt: ( localize(
|
|
637
|
-
|
|
654
|
+
2924,
|
|
638
655
|
"The resource at '{0}' uses a per-resource client identifier '{1}'. Enter the matching client secret (leave blank if none). The value is saved in OS secret storage; manage it later via the 'Set Client Secret' code lens in mcp.json.",
|
|
639
656
|
resource,
|
|
640
657
|
resourceClientId
|
|
641
658
|
)),
|
|
642
|
-
placeHolder: ( localize(
|
|
659
|
+
placeHolder: ( localize(2925, "Resource client secret")),
|
|
643
660
|
password: true,
|
|
644
661
|
ignoreFocusLost: true
|
|
645
662
|
});
|
|
@@ -667,4 +684,4 @@ MainThreadAuthentication = __decorate(
|
|
|
667
684
|
MainThreadAuthentication
|
|
668
685
|
);
|
|
669
686
|
|
|
670
|
-
export { MainThreadAuthentication };
|
|
687
|
+
export { MainThreadAuthentication, reviveSessionAccountIcon };
|
|
@@ -108,7 +108,7 @@ let RemoteExtensionManagementCLI = class RemoteExtensionManagementCLI extends Ex
|
|
|
108
108
|
if (
|
|
109
109
|
!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest) && !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
|
|
110
110
|
this.logger.info(( localize(
|
|
111
|
-
|
|
111
|
+
2926,
|
|
112
112
|
"Cannot install the '{0}' extension because it is declared to not run in this setup.",
|
|
113
113
|
getExtensionId(manifest.publisher, manifest.name)
|
|
114
114
|
)));
|
|
@@ -27,12 +27,12 @@ import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscod
|
|
|
27
27
|
export declare class MainThreadChatTask implements IChatTask {
|
|
28
28
|
content: IMarkdownString;
|
|
29
29
|
readonly kind = "progressTask";
|
|
30
|
-
readonly deferred: DeferredPromise<
|
|
30
|
+
readonly deferred: DeferredPromise<void | string>;
|
|
31
31
|
private readonly _onDidAddProgress;
|
|
32
32
|
get onDidAddProgress(): Event<IChatWarningMessage | IChatContentReference>;
|
|
33
33
|
readonly progress: (IChatWarningMessage | IChatContentReference)[];
|
|
34
34
|
constructor(content: IMarkdownString);
|
|
35
|
-
task(): Promise<
|
|
35
|
+
task(): Promise<void | string>;
|
|
36
36
|
isSettled(): boolean;
|
|
37
37
|
complete(v: string | void): void;
|
|
38
38
|
add(progress: IChatWarningMessage | IChatContentReference): void;
|