/** Owns runtime-side request/result pairing: emit, await, abort, idempotent on retry. */
import type { HostToolRequest, HostToolResult } from '../contracts/host-tool-api.js';
import { type InFlightMeta, type InFlightOpKind as InFlightOpKindValue } from './core-types.js';
export type HostToolRequestListener = (request: HostToolRequest) => void;
export declare const PENDING_HOST_TOOL_REQUESTS_DISCARDED_MESSAGE = "Host tool request was discarded before a result arrived.";
export interface PendingHostToolRequests {
    applyResult(result: HostToolResult): void;
    discardPending(): void;
    dispose(): void;
    request(request: HostToolRequest): Promise<HostToolResult>;
    subscribe(listener: HostToolRequestListener): () => void;
}
interface BridgeLogger {
    warn(message: string, meta?: Record<string, unknown>): void;
}
export interface CreatePendingHostToolRequestsOptions {
    readonly logger?: BridgeLogger;
    readonly schedule?: (cb: () => void, ms: number) => () => void;
    /** Per-kind runtime safety timeout in ms; 0/undefined = no timeout. */
    readonly getTimeoutMs?: (kind: string) => number;
    /** Returns the active turn's heartbeat wrap, or undefined when idle. */
    readonly getHeartbeatWrap?: () => (<T>(promise: Promise<T>, kind: InFlightOpKindValue, meta?: InFlightMeta) => Promise<T>) | undefined;
}
export declare function createPendingHostToolRequests(options?: CreatePendingHostToolRequestsOptions): PendingHostToolRequests;
export {};
//# sourceMappingURL=pending-host-tool-requests.d.ts.map