import type { ToolResult } from '../types.js'; export interface CursorData { offset: number; } /** Base64-encode cursor with version prefix. */ export declare function encodeCursor(data: CursorData): string; /** Decode and validate cursor. Returns null for invalid or wrong-version input. */ export declare function decodeCursor(cursor: string): CursorData | null; /** * Find the largest array in `data`, estimate the max item count via sampling, * refine with limited binary search (max 5 iterations), and return a trimmed copy. * * Non-array fields are preserved. The trimmed array gets `truncatedAt` and * `totalNodeCount` metadata appended. * * Sampling estimation avoids the O(n log n) serialization cost of pure binary * search on large arrays (~14 iterations x 4MB = ~56MB overhead). */ export declare function trimToArrayLimit(data: unknown, limitBytes: number): unknown; /** * Dual-threshold size control for MCP tool results. * * - Under 2 MB: pass through unchanged (same reference). * - 2–4 MB: add a warning content block. * - Over 4 MB: trim the largest array, add truncation metadata + notice. * * Controlled by `GODOT_MCP_RESPONSE_LIMIT` feature flag. */ export declare function truncateResponse(response: ToolResult): ToolResult;