import type { ToolSpec } from '../tool-registry/types.js'; import type { ToolScope } from './tool-scope.js'; /** Half the smallest provider limit known (OpenAI, 128). One constant - an application or a mode does not change it. */ export declare const MAX_OFFERED_TOOLS = 64; export declare const OPEN_TOOLS = "openTools"; /** The category the opening tool is recorded under - it is not registered; no mode names it. */ export declare const TOOL_BUDGET_CATEGORY = "tool-budget"; /** What the caller puts in front when the scope does not fit: whole categories first, then single tools while there is room. */ export interface ToolFront { categories?: string[]; tools?: string[]; } export declare class ToolBudgetError extends Error { front: number; code: string; constructor(front: number); } export interface ToolOffer { /** What the first call carries, openTools last when anything is left to open. */ offered: ToolSpec[]; /** In the scope and not offered - what openTools may open. */ openable: ToolSpec[]; } /** * What a turn starts with. The whole scope when it fits; otherwise the front categories (all of them, or it throws), * the front tools while there is room, and openTools. */ export declare function planToolOffer(scope: ToolScope, front?: ToolFront): ToolOffer; /** * The list of tools the model may open - one function builds it, wherever it goes. It goes in the prompt: OpenAI is * reported to refuse a tool description over 1024 characters, and Office's list runs to some 150 lines. */ export declare function openableToolCatalog(openable: ReadonlyArray): string; /** The opening tool's definition. */ export declare function openToolsSpec(open: (names: string[]) => unknown): ToolSpec; /** * The offer of one turn, as it grows. `open` adds tools to what the next call carries; it never runs one. */ export declare function toolOfferState(scope: ToolScope, front?: ToolFront): { /** What a call carries now. */ offered: () => any[]; isOffered: (name: string) => any; /** In the scope and still to be opened - a call to one is answered with how to open it. */ isOpenable: (name: string) => boolean; /** In the scope and not offered now. */ openable: () => string[]; /** The guidance of the categories in front - opened ones bring theirs with the result. */ frontGuidance: () => string[]; catalog: () => string; };