import type { ToolDefinition } from "../../tool/index.js"; import type { RuntimeToolLoadingMode } from "./runtime-tool-config.js"; /** Framework-owned model-facing tool used to load authorized schemas. */ export declare const TOOL_SEARCH_TOOL_NAME = "tool_search"; /** Run-local mutable exposure state. Create a new state for every child run. */ export type ToolExposureState = { loadedToolNames: Set; }; /** Authorized, visible, and deferred definitions for one model step. */ export type ToolExposurePlan = { authorized: ToolDefinition[]; visible: ToolDefinition[]; deferred: ToolDefinition[]; loadedToolNames: Set; maxLoadedTools?: number; }; /** Private versioned state persisted by the framework between resumed steps. */ export type ToolExposureCheckpoint = { /** v1 names were lexicographically sorted; v2 preserves oldest-to-newest recency. */ version: 1 | 2; loadedToolNames: string[]; }; export declare const AGENT_RUN_TOOL_EXPOSURE_CHECKPOINT_EVENT_TYPE: "AGENT_RUN_TOOL_EXPOSURE_CHECKPOINT"; /** Private durable event carrying trusted tool exposure state. */ export type ToolExposureCheckpointEvent = ToolExposureCheckpoint & { type: typeof AGENT_RUN_TOOL_EXPOSURE_CHECKPOINT_EVENT_TYPE; }; /** Schema-free model-visible search result. */ export type ToolSearchMatch = { name: string; description: string; status: "available" | "loaded"; }; /** Search output plus bounded observability counters. */ export type ToolSearchResult = { matches: ToolSearchMatch[]; resultCount: number; loadedCount: number; miss: boolean; }; /** Return whether a persisted name matches the existing non-empty tool id contract. */ export declare function isValidToolExposureCheckpointName(value: unknown): value is string; /** Return whether a checkpoint version can be restored by this runtime. */ export declare function isSupportedToolExposureCheckpointVersion(value: unknown): value is ToolExposureCheckpoint["version"]; /** Create fresh run-local tool exposure state. */ export declare function createToolExposureState(loadedToolNames?: Iterable): ToolExposureState; /** Create the framework fallback tool definition without exposing catalog schemas. */ export declare function createToolSearchDefinition(): ToolDefinition; /** Plan the schemas visible to the model for the current step. */ export declare function createToolExposurePlan(input: { authorized: readonly ToolDefinition[]; mode: RuntimeToolLoadingMode; state: ToolExposureState; bootstrapToolNames?: ReadonlySet; maxVisibleTools?: number; }): ToolExposurePlan; /** Search currently authorized executable schemas without returning any schema. */ export declare function searchToolExposure(input: { query: string; authorized: readonly ToolDefinition[]; available?: readonly ToolDefinition[]; state: ToolExposureState; maxLoadedTools?: number; }): ToolSearchResult; /** Snapshot loaded names for private framework persistence. */ export declare function createToolExposureCheckpoint(authorized: readonly ToolDefinition[], state: ToolExposureState): ToolExposureCheckpoint; /** Convert a private checkpoint into its durable root-run event. */ export declare function createToolExposureCheckpointEvent(checkpoint: ToolExposureCheckpoint): ToolExposureCheckpointEvent; /** Restore supported private state and re-apply current authorization. */ export declare function restoreToolExposureState(checkpoint: { version: number; loadedToolNames?: unknown; } | null | undefined, authorized: readonly ToolDefinition[]): ToolExposureState; //# sourceMappingURL=tool-exposure.d.ts.map