import type { ToolMiddleware } from "./tools2/types.js";
import type { Logger } from "../../util/logger.js";
export declare const DEFAULT_MAX_OUTPUT_CHARS = 25000;
/**
 * Middleware to limit the output length of a tool's execute method.
 * If the output exceeds the specified maxChars, an error is thrown that includes the truncated output.
 *
 * This is to prevent excessively large outputs that could lead to performance issues or exceed system limits.
 *
 * **Skipping the limit:**
 * Tools can provide a `skipOutputLimit` function that receives the output and returns true to bypass
 * this check. This is useful for tools that output content type with media parts (e.g., screenshots),
 * as media parts are handled separately by the AI SDK and don't contribute to token count in the
 * same way as text/JSON outputs.
 */
export declare function outputLimiter(maxChars?: number): ToolMiddleware;
/**
 * Middleware to scan and redact secrets from tool outputs.
 *
 * Only scans outputs from tools that may return sensitive data (file reads,
 * API tests, integration queries). Other tools are passed through without scanning.
 *
 * @param options - Configuration options
 * @param options.enabled - Whether secret scanning is enabled (default: true)
 * @param options.timeout - Timeout for secret scanning in ms (default: scanner's DEFAULT_SCAN_TIMEOUT_MS)
 */
export declare function secretScanningMiddleware(options?: {
    enabled?: boolean;
    timeout?: number;
}): ToolMiddleware;
/**
 * Error metadata safe for Tier 2 logging (excludes stack traces and sensitive context).
 *
 * Uses the same `kind` field as `ErrorMeta` from logger.ts for structural
 * compatibility, but omits stack traces which contain file paths (Tier 1 only).
 */
export interface Tier2ErrorMeta {
    error: {
        kind: string;
        message: string;
    };
}
/**
 * Extracts error metadata safe for Tier 2 logging.
 * Excludes stack traces (contain file paths) and response bodies (may contain secrets).
 *
 * Contrast with `getErrorMeta` from logger.ts which preserves stack traces
 * for local/Tier 1 logging.
 *
 * @param error - The error to extract metadata from
 * @returns Error metadata suitable for Tier 2 logging (no stack traces)
 */
export declare function getTier2ErrorMeta(error: unknown): Tier2ErrorMeta;
/**
 * Middleware to log tool execution with safe error handling.
 *
 * Tool inputs and outputs are logged through the wrapped logger, which applies
 * regex-based secret sanitization (sanitizeLogMessage/sanitizeLogObject) automatically.
 * Heavy secret scanning (Trufflehog) is intentionally NOT done on inputs here --
 * tool inputs are LLM-generated and the user prompt is already scanned upstream.
 *
 * @param logger - Logger instance to use for logging
 * @returns ToolMiddleware that logs tool execution
 */
export declare function toolLoggingMiddleware(logger: Logger): ToolMiddleware;
//# sourceMappingURL=middleware.d.ts.map