/**
 * Shared catch-block helper for host-tool handlers.
 *
 * Every handler's error path follows the same shape: branch on
 * `signal.aborted` to pick Cancelled vs Failed and write a `userMessage` on
 * the top-level result. The synthesized failure carries no typed `details` —
 * the tool's success-shape payload is, by definition, not produced on the
 * failure path.
 */
import { type HostToolRequest, type HostToolResult, type ToolContract } from './host-tool.js';
export interface CancelOrFailOptions {
    readonly contract: Pick<ToolContract, 'kind'>;
    readonly request: HostToolRequest;
    readonly error: unknown;
    readonly signal: AbortSignal | undefined;
    /** Message used when the abort signal fired. */
    readonly cancelledMessage: string;
}
/**
 * Build a Cancelled-or-Failed `HostToolResult` from a thrown error.
 *
 * Returns Cancelled when `signal.aborted === true`, Failed otherwise. The
 * top-level `userMessage` carries the cancelled message when aborted, or the
 * coerced error string when failed.
 */
export declare function createCancelOrFailResult(options: CancelOrFailOptions): HostToolResult;
//# sourceMappingURL=cancel-or-fail.d.ts.map