import type { ToolResultGuardrailContext, ToolResultGuardrailSpec } from '../../types/guardrail/index.js'; import type { ToolResult } from '../../types/tool/index.js'; import type { Logger } from '../../utils/logger.js'; /** * A tool result was refused terminally. * * Thrown rather than returned because the caller's failure path turns every * exception into an ordinary tool failure the model then reads and works * around — which is exactly what a terminal refusal must not become. The * distinct type is what lets that path re-throw this one and convert the * rest. A `halt` reported as a failed tool call would be a `refuse` with * extra steps. */ export declare class ToolResultHalted extends Error { readonly guardrail: string; constructor(guardrail: string, reason: string); } /** * Screen a tool's result before anything downstream reads it. * * Runs every guardrail in order and stops at the first refusal. Rewrites * compose — each guardrail sees what the previous one produced — matching * the output-guardrail path, so a redaction chain behaves the same at both * boundaries. * * Returns the result to use. A refusal comes back as a failed `ToolResult` * carrying the reason, because that is the shape the model already knows * how to read: it is the same thing a tool that could not do its job * returns, and the alternative — a blank result — tells the model the tool * found nothing, which is a different claim and a false one. */ export declare function screenToolResult(guardrails: readonly ToolResultGuardrailSpec[] | undefined, result: ToolResult, ctx: Omit, log: Logger): Promise; //# sourceMappingURL=screen.d.ts.map