import { Disposable, Emitter, Event } from '@theia/core'; import { ToolCallChatResponseContent } from '../common'; export interface PendingToolConfirmation { readonly chatId: string; readonly response: ToolCallChatResponseContent; allow(): void; deny(): void; } /** * Tracks tool confirmations that are currently awaiting user input across all chats. * * Used to drive keyboard shortcuts that approve or deny the most recently surfaced * pending confirmation. Queries are scoped by chat id so a shortcut only ever targets a * confirmation in the chat the user is interacting with, never one in a different chat. */ export declare class PendingToolConfirmationTracker { protected readonly pending: PendingToolConfirmation[]; protected readonly onChangedEmitter: Emitter; protected readonly introShownChats: Set; readonly onChanged: Event; /** * Whether the one-time tool-confirmation intro has already been shown for the given chat. * * Pure query - call {@link markIntroShown} to record that it was shown. Kept separate so it * can be used from a React render without side effects. */ hasShownIntro(chatId: string): boolean; /** * Marks the tool-confirmation intro as shown for the given chat, so it is only rendered once * per chat session. */ markIntroShown(chatId: string): void; register(entry: PendingToolConfirmation): Disposable; unregister(entry: PendingToolConfirmation): void; /** * Returns the most recently registered pending confirmation, optionally restricted to a single * chat. Without a `chatId` it considers all chats (e.g. to drive a global context key); with a * `chatId` it only returns a confirmation belonging to that chat. */ getLatest(chatId?: string): PendingToolConfirmation | undefined; /** * Whether there is a pending confirmation, optionally restricted to a single chat. */ hasPending(chatId?: string): boolean; } //# sourceMappingURL=pending-tool-confirmation-tracker.d.ts.map