mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 17:32:41 +00:00
remove user consent for chat (#204698)
This commit is contained in:
parent
768c8e3e93
commit
3a00525d5c
|
@ -338,8 +338,7 @@ Registry.as<IExtensionFeaturesRegistry>(ExtensionFeaturesExtensions.ExtensionFea
|
||||||
label: nls.localize('chat', "Chat"),
|
label: nls.localize('chat', "Chat"),
|
||||||
description: nls.localize('chatFeatureDescription', "Allows the extension to make requests to the Large Language Model (LLM)."),
|
description: nls.localize('chatFeatureDescription', "Allows the extension to make requests to the Large Language Model (LLM)."),
|
||||||
access: {
|
access: {
|
||||||
canToggle: true,
|
canToggle: false,
|
||||||
requireUserConsent: true,
|
|
||||||
},
|
},
|
||||||
renderer: new SyncDescriptor(ChatFeatureMarkdowneRenderer),
|
renderer: new SyncDescriptor(ChatFeatureMarkdowneRenderer),
|
||||||
});
|
});
|
||||||
|
|
|
@ -104,19 +104,20 @@ class ExtensionFeaturesManagementService extends Disposable implements IExtensio
|
||||||
}
|
}
|
||||||
|
|
||||||
if (featureState.disabled === undefined) {
|
if (featureState.disabled === undefined) {
|
||||||
const extensionDescription = this.extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
let enabled = true;
|
||||||
const confirmationResult = await this.dialogService.confirm({
|
if (feature.access.requireUserConsent) {
|
||||||
title: localize('accessExtensionFeature', "Access '{0}' Feature", feature.label),
|
const extensionDescription = this.extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
||||||
message: localize('accessExtensionFeatureMessage', "'{0}' extension would like to access the '{1}' feature.", extensionDescription?.displayName ?? extension.value, feature.label),
|
const confirmationResult = await this.dialogService.confirm({
|
||||||
detail: justification ?? feature.description,
|
title: localize('accessExtensionFeature', "Access '{0}' Feature", feature.label),
|
||||||
custom: true,
|
message: localize('accessExtensionFeatureMessage', "'{0}' extension would like to access the '{1}' feature.", extensionDescription?.displayName ?? extension.value, feature.label),
|
||||||
primaryButton: localize('allow', "Allow"),
|
detail: justification ?? feature.description,
|
||||||
cancelButton: localize('disallow', "Don't Allow"),
|
custom: true,
|
||||||
});
|
primaryButton: localize('allow', "Allow"),
|
||||||
this.setEnablement(extension, featureId, confirmationResult.confirmed);
|
cancelButton: localize('disallow', "Don't Allow"),
|
||||||
if (!confirmationResult.confirmed) {
|
});
|
||||||
return false;
|
enabled = confirmationResult.confirmed;
|
||||||
}
|
}
|
||||||
|
this.setEnablement(extension, featureId, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
featureState.accessData.current = {
|
featureState.accessData.current = {
|
||||||
|
|
Loading…
Reference in a new issue