1
>
/*---------------------------------------------------------------------------------------------
chatPermissionWarnings.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { Codicon } from '../../../../base/common/codicons.js';
7
>
import { MarkdownString } from '../../../../base/common/htmlContent.js';
8
>
import Severity from '../../../../base/common/severity.js';
9
>
import { ThemeIcon } from '../../../../base/common/themables.js';
10
>
import { localize } from '../../../../nls.js';
11
>
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
12
>
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
13
>
import { ASSISTED_APPROVAL_DONT_SHOW_AGAIN_KEY, AUTO_APPROVE_DONT_SHOW_AGAIN_KEY, AUTOPILOT_DONT_SHOW_AGAIN_KEY } from './chatPermissionStorageKeys.js';
14
>
import { ChatConfiguration, ChatPermissionLevel } from './constants.js';
15
>
16
>
/**
17
>
* In-memory record of warnings already accepted in this VS Code session.
18
>
* Checked alongside the persisted "Don't show again" storage value so that the
19
>
* warning isn't repeated within a session even when the user didn't tick the
20
>
* checkbox.
21
>
*
22
>
* Per-renderer; the `StorageScope.PROFILE` storage entry is what synchronizes
23
>
* the dismissed state across windows (workbench and Agents).
24
>
*/
25
>
const shownWarnings = new Set<ChatPermissionLevel>();
26
>
27
function dontShowAgainKey(level: ChatPermissionLevel): string | undefined {
28
if (level === ChatPermissionLevel.Autopilot) {