/** * Response size budget for tool results sent to the client. * * A single tool call can return megabytes (10,000 table rows, a full bill * text), which floods the model's context or gets cut off mid-JSON by the * client. Results over the budget are shortened while staying valid JSON: * * 1. The largest arrays (table rows, list items) are cut to the longest * prefix that fits. * 2. If that isn't enough, the longest strings are clipped. * 3. A `truncatedToFit` marker says what was shortened, the summary notes * it, and a columnar `data` object gets `truncated: true`. * * Non-JSON text is clipped with a note. code_mode reads raw tool output * through the registry, so it still sees everything. * * MAX_RESPONSE_BYTES sets the budget (UTF-8 bytes); 0 turns it off. */ export declare const DEFAULT_MAX_RESPONSE_BYTES = 150000; /** Budget from MAX_RESPONSE_BYTES: a positive integer, 0 for none, else the default. */ export declare function maxResponseBytes(env?: NodeJS.ProcessEnv): number; /** Shorten `text` to at most `maxBytes` (see the module comment). Unchanged when it already fits. */ export declare function fitResponse(text: string, maxBytes: number): string; /** A tool result with the budget applied to its text. Non-text results pass through. */ export declare function budgetResult(result: unknown, maxBytes: number): unknown; //# sourceMappingURL=response-budget.d.ts.map