import { ToolProvider, ToolRequest } from '@theia/ai-core'; import { ToolInvocationContext } from '@theia/ai-core/lib/common/language-model'; import { OpenerService } from '@theia/core/lib/browser'; import { Deferred } from '@theia/core/lib/common/promise-util'; import { ResourceProvider } from '@theia/core/lib/common/resource'; import URI from '@theia/core/lib/common/uri'; import { EditorManager } from '@theia/editor/lib/browser'; import { ScmService } from '@theia/scm/lib/browser/scm-service'; import { WorkspaceFunctionScope } from './workspace-functions'; import { ContentRef, PathContentRef, UserInteractionLink, UserInteractionResult, UserInteractionStep } from '../common/user-interaction-tool'; import { ILogger } from '@theia/core'; interface PendingInteraction { deferred: Deferred; steps: UserInteractionStep[]; resolved: boolean; /** * Latest partial result pushed by the renderer via {@link UserInteractionTool.recordPartial}. * Used to resolve the handler with what the user has collected so far when the interaction * is canceled. If absent (no renderer mounted) the tool resolves with all steps skipped. */ latestPartial?: UserInteractionResult; } export declare class UserInteractionTool implements ToolProvider { static ID: string; protected readonly openerService: OpenerService; protected readonly editorManager: EditorManager; protected readonly scmService: ScmService; protected readonly workspaceScope: WorkspaceFunctionScope; protected readonly resourceProvider: ResourceProvider; protected readonly logger: ILogger; protected readonly pendingInteractions: Map; getTool(): ToolRequest; /** * Resolve the pending interaction with the given final result. The renderer is the single * source of truth for the collected user input and passes the full result here on Finish * (or on a per-option click for single-step interactions). */ completeInteraction(toolCallId: string, result: UserInteractionResult): void; /** * Push the latest partial result so the tool can resolve with it on cancellation. * The renderer should call this whenever the user changes step state. Calls for * an already-resolved interaction are silently ignored. */ recordPartial(toolCallId: string, partial: UserInteractionResult): void; protected resolveInteraction(toolCallId: string, result: UserInteractionResult): void; protected cancelPending(toolCallId: string): void; openLink(link: UserInteractionLink): Promise; protected resolveUri(ref: PathContentRef): URI | undefined; protected handleInteraction(argString: string, ctx: ToolInvocationContext | undefined): Promise; protected resolveDiffSideUri(ref: ContentRef): Promise; protected errorContentUri(path: string, gitRef: string): URI; protected refNotFoundUri(path: string, gitRef: string): URI; protected fileNotFoundUri(path: string): URI; protected emptyContentUri(path: string): URI; protected canResolveUri(uri: URI): Promise; } export {}; //# sourceMappingURL=user-interaction-tool.d.ts.map