import * as React from '@theia/core/shared/react'; import { ContextMenuRenderer, MarkdownRenderer, OpenerService } from '@theia/core/lib/browser'; import { ToolCallChatResponseContent } from '@theia/ai-chat/lib/common'; import { ToolRequest } from '@theia/ai-core'; import { CommandMenu, ContextExpressionMatcher, MenuPath } from '@theia/core/lib/common/menu'; import { ToolConfirmationMode as ToolConfirmationPreferenceMode } from '@theia/ai-chat/lib/common/chat-tool-preferences'; import { ToolConfirmationManager } from '@theia/ai-chat/lib/browser/chat-tool-preference-bindings'; import { PendingToolConfirmationTracker } from '@theia/ai-chat/lib/browser/pending-tool-confirmation-tracker'; export interface CountdownTimerProps { response: ToolCallChatResponseContent; } export declare const CountdownTimer: React.FC; export type ToolConfirmationState = 'pending' | 'waiting' | 'allowed' | 'denied' | 'rejected'; export type ConfirmationScope = 'once' | 'session' | 'forever'; /** * Shared hook that manages the confirmation state machine for tool calls. * * Handles initial state computation, auto-allow/deny via preference mode, * and wiring up the response's confirmation and user-confirmation promises. */ export declare function useToolConfirmationState(response: ToolCallChatResponseContent, confirmationMode: ToolConfirmationPreferenceMode): { confirmationState: ToolConfirmationState; rejectionReason: unknown; }; export declare function createConfirmationHandlers(toolId: string | undefined, response: ToolCallChatResponseContent, toolConfirmationManager: ToolConfirmationManager, chatId: string, toolRequest?: ToolRequest): { handleAllow: (scope: ConfirmationScope) => void; handleDeny: (scope: ConfirmationScope, reason?: string) => void; }; export interface ToolConfirmationCallbacks { toolRequest?: ToolRequest; onAllow: (scope: ConfirmationScope) => void; onDeny: (scope: ConfirmationScope, reason?: string) => void; } export interface ToolConfirmationKeybindingHints { allow?: string; deny?: string; } export interface ToolConfirmationActionsProps extends ToolConfirmationCallbacks { toolName: string; contextMenuRenderer: ContextMenuRenderer; autoFocus?: boolean; keybindingHints?: ToolConfirmationKeybindingHints; } export declare class InlineActionMenuNode implements CommandMenu { readonly id: string; readonly label: string; private readonly action; readonly sortString: string; readonly icon?: string | undefined; constructor(id: string, label: string, action: () => void, sortString: string, icon?: string | undefined); isVisible(_effectiveMenuPath: MenuPath, _contextMatcher: ContextExpressionMatcher, _context: T | undefined): boolean; isEnabled(): boolean; isToggled(): boolean; run(): Promise; } export declare const ToolConfirmationActions: React.FC; export interface ToolConfirmationProps extends Pick { response: ToolCallChatResponseContent; onAllow: (scope?: ConfirmationScope) => void; onDeny: (scope?: ConfirmationScope, reason?: string) => void; contextMenuRenderer: ContextMenuRenderer; openerService: OpenerService; pendingTracker?: PendingToolConfirmationTracker; keybindingHints?: ToolConfirmationKeybindingHints; chatId?: string; markdownRenderer?: MarkdownRenderer; } export declare const ToolConfirmation: React.FC; export interface WithToolCallConfirmationProps { response: ToolCallChatResponseContent; confirmationMode: ToolConfirmationPreferenceMode; toolConfirmationManager: ToolConfirmationManager; toolRequest?: ToolRequest; chatId: string; getArgumentsLabel?: (toolName: string | undefined, args: string | undefined) => string; showArgsTooltip?: (response: ToolCallChatResponseContent, target: HTMLElement | undefined) => void; requestCanceled: boolean; contextMenuRenderer: ContextMenuRenderer; openerService: OpenerService; pendingTracker?: PendingToolConfirmationTracker; keybindingHints?: ToolConfirmationKeybindingHints; markdownRenderer?: MarkdownRenderer; } export declare function withToolCallConfirmation

(WrappedComponent: React.ComponentType

): React.FC

; //# sourceMappingURL=tool-confirmation.d.ts.map