Path: blob/main/src/vs/workbench/api/browser/mainThreadChatInputNotification.ts
13397 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Disposable } from '../../../base/common/lifecycle.js';6import { ChatInputNotificationSeverity, IChatInputNotificationService } from '../../contrib/chat/browser/widget/input/chatInputNotificationService.js';7import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';8import { ChatInputNotificationDto, MainContext, MainThreadChatInputNotificationShape } from '../common/extHost.protocol.js';910@extHostNamedCustomer(MainContext.MainThreadChatInputNotification)11export class MainThreadChatInputNotification extends Disposable implements MainThreadChatInputNotificationShape {1213constructor(14_extHostContext: IExtHostContext,15@IChatInputNotificationService private readonly _chatInputNotificationService: IChatInputNotificationService,16) {17super();18}1920$setNotification(notification: ChatInputNotificationDto): void {21this._chatInputNotificationService.setNotification({22id: notification.id,23severity: notification.severity as number as ChatInputNotificationSeverity,24message: notification.message,25description: notification.description,26actions: notification.actions,27dismissible: notification.dismissible,28autoDismissOnMessage: notification.autoDismissOnMessage,29});30}3132$disposeNotification(id: string): void {33this._chatInputNotificationService.deleteNotification(id);34}35}363738