import type { Refusal } from '../../types.ts';
import type { ExecuteResult } from '../workspace/types.ts';
export declare function decode(value: Uint8Array | null | undefined): string;
/**
 * The one line a text surface appends for a refusal, newline included, or
 * the empty string when there is no record. The refusal's stderr is the
 * bare `Permission denied` or the path's own error, which never says why.
 * Mirrors Python's `refusal_line`.
 */
export declare function refusalLine(refusal: Refusal | null): string;
/**
 * Append the refusal's reason as one more line after the shell's own
 * output, for a surface that hands the agent text.
 */
export declare function withRefusal(text: string, refusal: Refusal | null): string;
/**
 * A tool's failure as the agent reads it: a filesystem error as
 * `<path>: <phrase>` (a policy's refusal reads as `Permission denied`),
 * or the phrase alone when no path was stamped and the message adds
 * nothing, anything else in its own words, then the refusal's line when a
 * policy refused the op. Mirrors Python's `error_text`.
 */
export declare function errorText(error: unknown): string;
export declare function ioToStr(io: ExecuteResult): string;
/**
 * The edit tools' one substitution: `content` with `oldString` replaced
 * once, or everywhere under `replaceAll`, beside how many times it occurs.
 * The replacement is literal (no `$&` or `$1` expansion), as Python's
 * `str.replace` is; a count other than one without `replaceAll` is the
 * caller's refusal to word. Mirrors Python's `replace_text`.
 */
export declare function replaceText(content: string, oldString: string, newString: string, replaceAll: boolean): [string, number];
//# sourceMappingURL=io_text.d.ts.map