export interface ToolTimeoutConfig { /** Default timeout in seconds when agent omits the field */ default: number; /** Minimum allowed timeout in seconds */ min: number; /** Maximum allowed timeout in seconds (per-tool ceiling) */ max: number; } export declare const TOOL_TIMEOUTS: { readonly bash: { readonly default: 300; readonly min: 1; readonly max: 3600; }; readonly eval: { readonly default: 30; readonly min: 1; readonly max: 3600; }; readonly browser: { readonly default: 30; readonly min: 1; readonly max: 300; }; readonly computer: { readonly default: 120; readonly min: 1; readonly max: 300; }; readonly ssh: { readonly default: 60; readonly min: 1; readonly max: 3600; }; readonly fetch: { readonly default: 20; readonly min: 1; readonly max: 45; }; readonly lsp: { readonly default: 20; readonly min: 5; readonly max: 300; }; readonly debug: { readonly default: 30; readonly min: 5; readonly max: 300; }; readonly ida: { readonly default: 120; readonly min: 1; readonly max: 3600; }; }; export type ToolWithTimeout = keyof typeof TOOL_TIMEOUTS; /** * Clamp a raw timeout to the allowed range for a tool. * * When `rawTimeout` is undefined the tool's `default` is used. A positive * `maxTimeout` (the `tools.maxTimeout` global ceiling) caps the *resolved* * value — including the default-fallback path — before the per-tool `min`/`max` * floor and ceiling apply, so a configured global cap governs calls where the * agent omits `timeout`, not only explicitly-passed values. `maxTimeout <= 0` * means no global cap. */ export declare function clampTimeout(tool: ToolWithTimeout, rawTimeout?: number, maxTimeout?: number): number; /** Budgets for one `lsp` tool call, in seconds. */ export interface LspTimeouts { /** Wall-clock deadline for the whole call. */ call: number; /** How long to wait for a server that computes its answer on demand (project-aware diagnostics). */ wait: number; } /** * Resolve an `lsp` call's budgets from its `timeout` argument and the `lsp.requestTimeout` setting. * * Without an argument the server wait is the setting, and the call deadline is the tool default * raised to the setting so the call itself never cuts a slow server off first. An explicit * `timeout` sets both, raising or lowering them. Every value stays within the tool's * `min`/`max` and under a positive `maxTimeout` (`tools.maxTimeout`), like {@link clampTimeout}. */ export declare function resolveLspTimeouts(requested: number | undefined, requestTimeout: number, maxTimeout?: number): LspTimeouts;