export declare function safeHook(fn: (input: I, output: O) => Promise): (input: I, output: O) => Promise; export declare function composeHandlers(...fns: Array<(input: I, output: O) => Promise>): (input: I, output: O) => Promise; declare function isFileValidationEnabled(): boolean; declare function getMaxFileBytes(): number; declare function getMaxScanDepth(): number; export declare function validateWriterPath(directory: string, filename: string): string; export declare function checkFileSizeLimit(filePath: string): void; export declare function checkDirectoryDepth(currentDepth: number): void; export declare function isSymlink(filePath: string): boolean; export { getMaxFileBytes, getMaxScanDepth, isFileValidationEnabled }; export declare function readWriterFileAsync(directory: string, filename: string): Promise; /** * Estimates the number of tokens in a text string. * * **Formula:** `tokenCount ≈ Math.ceil(characterCount × 0.33)` * * This is based on the general observation that one token corresponds to roughly * 3 characters of English text on average. The multiplier of 0.33 (1/3) provides * a conservative upper-bound estimate. * * **Accuracy:** * - Expected variance: approximately ±40% * - Actual token counts vary significantly based on: * - Language (non-English text often requires more tokens per character) * - Content type (code, technical terms, vs. natural language) * - Tokenizer model (GPT-3/4, Claude, etc. use different tokenization schemes) * - Presence of special characters, whitespace, and punctuation * * **Recommendation:** * Use this function only for rough budget planning and preliminary size estimates. * For precise token counting required for API limits or billing, use the actual * tokenizer of the target model (e.g., tiktoken for OpenAI models). * * @param text - The input string to estimate token count for * @returns The estimated number of tokens (rounded up), or 0 for empty/null input */ export declare function estimateTokens(text: string): number;