/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ export interface ToolOutputSettingsProvider { getEphemeralSettings(): Record; } export declare const DEFAULT_MAX_TOKENS = 50000; export declare const DEFAULT_TRUNCATE_MODE = "warn"; export interface MiddleClipResult { content: string; wasTruncated: boolean; originalLength: number; } export declare const ESCAPE_BUFFER_PERCENTAGE = 0.8; export declare function estimateTokens(text: string): number; export declare function getEffectiveTokenLimit(maxTokens: number): number; export interface OutputLimitConfig { maxTokens?: number; truncateMode?: 'warn' | 'truncate' | 'sample'; } export interface TruncatedOutput { content: string; wasTruncated: boolean; originalTokens?: number; message?: string; } /** * Clip text by removing the middle while preserving configurable head/tail. * Useful for console-style output where both the start (setup/context) * and end (results/errors) are important. */ export declare function clipMiddle(content: string, maxChars: number, headRatio: number, tailRatio: number): MiddleClipResult; /** * Get output limit configuration from ephemeral settings */ export declare function getOutputLimits(config: ToolOutputSettingsProvider): OutputLimitConfig; /** * Check if content exceeds token limit and handle according to truncate mode * Uses escape buffer to account for JSON stringification inflation */ export declare function limitOutputTokens(content: string, config: ToolOutputSettingsProvider, toolName: string): TruncatedOutput; /** * Format output with truncation handling */ export declare function formatLimitedOutput(result: TruncatedOutput): { llmContent: string; returnDisplay: string; };