import type { ChatbotWidgetRuntime } from './types'; /** Generic host transport. Agent metadata belongs to this adaptive, not the bridge. */ export interface HostToolResults { subscribeToolResults(listener: (result: unknown) => void, options?: { metadataKey?: string; }): () => void; /** * The card's own way to ask the server a question, through the host. * * A reloaded card has nothing on screen and no live turn to wait for, so it * calls the app-only read tool and applies what comes back. The host * attaches the shopper's credential, which is why the card needs none. */ callServerTool?(params: { name: string; arguments?: Record; }): Promise; /** * Called whenever the host says anything about a tool call (input, a * result of any shape, a cancellation), and at once on subscribe if it * already has. What the missing-result check stands down on. */ subscribeToolActivity?(listener: () => void): () => void; /** * Where the tool call this card was drawn for stands, the latest replayed * on subscribe. Its input names the session the conversation is in. */ subscribeToolCall?(listener: (call: { phase: 'input'; arguments: Record; } | { phase: 'result'; } | { phase: 'cancelled'; }) => void): () => void; } /** * How long a card says its answer is on its way when neither the answer nor a * cancellation ever comes (a host that stops a turn without saying so). */ export declare const PENDING_MAX_MS = 120000; export interface HostAgentControllerOptions { /** How long a card that has heard nothing waits before reporting it. */ missingResultMs?: number; } interface HostUiInitialization { setInteractive?(interactive: boolean): void; } /** One host conversation owns one store; host delivery may synchronously replay. */ export declare function activateHostAgentController(runtime: ChatbotWidgetRuntime, bridge: HostToolResults, hostUi?: HostUiInitialization, options?: HostAgentControllerOptions): { acceptHostUi: (payload: unknown) => void; consumeToolResult: (result: unknown, { earlyRead }?: { earlyRead?: boolean; }) => Promise; whenIdle: () => Promise; dispose(): void; }; /** App activation runs without mounting a chat widget on MCP host surfaces. */ export declare function activateHostAgent(runtime: unknown): (() => void) | undefined; /** Narrow manifest entry point; runtime owns queueing before adaptive activation. */ export declare function acceptHostUi(runtime: { acceptHostUi?: (payload: unknown) => void; }, payload: unknown): void; export {}; //# sourceMappingURL=hostAgentController.d.ts.map