export type FileStorageFormat = "json" | "jsonl"; export interface FileStorageArgs { saveToFile?: boolean | undefined; filePath?: string | undefined; format?: FileStorageFormat | undefined; overwrite?: boolean | undefined; } export interface StreamingFileStorageOptions { dataStream: AsyncIterable; filePath?: string | undefined; rootDir: string; format?: FileStorageFormat | undefined; overwrite?: boolean | undefined; /** * When true (default), JSON output is wrapped in `[ ... ]`. Set to false to * write a single object/value as raw JSON without array wrapping. */ jsonAsArray?: boolean | undefined; } export interface FileStorageResult { data: T; savedToFile?: boolean | undefined; savedTo?: string | undefined; } /** * Streams data to a JSON or JSONL file. The target path is always resolved * inside rootDir; absolute paths and traversal segments are rejected. * On error the partial file is removed. */ export declare function streamDataToFileAsync(options: StreamingFileStorageOptions): Promise; /** * MCP tool argument schema for file storage options. Re-used from many tools. */ export declare const fileStorageArgs: { saveToFile: { type: "boolean"; optional: boolean; describe: string; }; filePath: { type: "string"; optional: boolean; describe: string; }; format: { type: "string"; optional: boolean; describe: string; choices: readonly ["json", "jsonl"]; }; overwrite: { type: "boolean"; optional: boolean; describe: string; }; }; /** * Persists tool result to a file when args.saveToFile is true. The path is * resolved relative to rootDir; absolute paths and traversal segments are * rejected by resolveOutputPath. */ export declare function processWithFileStorage(args: FileStorageArgs, data: T, rootDir: string): Promise>; //# sourceMappingURL=file-storage.d.ts.map