/**
 * Format a duration in milliseconds to a human-readable string.
 * Shows seconds (with 1 decimal) if >= 1000ms, otherwise shows ms.
 *
 * @example
 * formatDuration(450) // "450ms"
 * formatDuration(1234) // "1.2s"
 * formatDuration(5678) // "5.7s"
 */
export declare function formatDuration(ms: number | undefined): string;
/**
 * Check if a tool result is an error response.
 * Handles both the new ok: false pattern and legacy error patterns.
 */
export declare function isToolError(result: unknown): boolean;
/**
 * Extract the error message from a tool result.
 * Checks multiple common fields: error, stderr, message, detail, details, reason.
 */
export declare function getErrorMessage(result: unknown): string | null;
/**
 * Extract error details from a tool result.
 * Returns the details object if present and valid.
 */
export declare function getErrorDetails(result: unknown): Record<string, unknown> | null;
//# sourceMappingURL=utils.d.ts.map