import * as fs from 'node:fs/promises'; import { type ToolDefinition } from '@opencode-ai/plugin/tool'; import { MAX_FILE_SIZE, MAX_DIRECTORY_DEPTH } from '../config/constants'; /** * Sleep for a given number of milliseconds */ export declare function sleep(ms: number): Promise; /** * Calculate retry delay with exponential backoff and ±20% jitter */ export declare function calculateRetryDelay(attempt: number, baseDelay?: number): number; /** * Check if an error is retryable */ export declare function isRetryableError(error: unknown): boolean; /** * Execute a write operation with retry logic * The writeFn parameter allows for dependency injection during testing */ export declare function writeFileWithRetry(filePath: string, content: string, options: { encoding: BufferEncoding; }, writeFn?: typeof fs.writeFile, retryEnabled?: boolean, maxRetries?: number): Promise; /** * Read a file from the .writer/ directory. */ export declare const read_writer_file: ToolDefinition; /** * Write content to a file in the .writer/ directory. Overwrites if exists. */ export declare const write_writer_file: ToolDefinition; /** * List all files in the .writer/ directory recursively. */ export declare const list_writer_files: ToolDefinition; export { MAX_FILE_SIZE, MAX_DIRECTORY_DEPTH };