import { type ToolApprovalConfiguration, type ToolSet } from "ai"; import type { ModelProfile } from "#harness/model-profile.js"; import type { HarnessToolDefinition } from "#harness/execute-tool.js"; import type { CallResolver, HarnessToolMap } from "#harness/types.js"; import type { ToolExecuteOptions } from "#tools/definition.js"; /** * Builds an AI SDK `ToolSet` from unified harness tool definitions, described * by `describe`. Each call's output is projected by the entry `resolve` * resolves it to. * * Tools without `execute` are surfaced to the model as client-side tools * (no server execution). * * Entries listed in `disabledProviderTools` are skipped entirely. Used * by the harness recovery path when a gateway fallback provider has * rejected a provider-specific tool — the tool is dropped for the * retry call so the request can proceed without it. */ export declare function buildToolSet(input: { readonly describe: (definition: HarnessToolDefinition) => string; readonly disabledProviderTools?: ReadonlySet; readonly resolve: CallResolver; readonly tools: HarnessToolMap; }): ToolSet; /** * Wraps a tool's `execute` so a returned {@link AuthorizationSignal} is * stashed out-of-band ({@link stashToolInterrupt}) for the park detector while * the AI SDK records an opaque {@link AuthorizationPendingModelOutput} that * omits OAuth URLs, user codes, and hook URLs from model-facing history. * Returns `undefined` for client-side tools (no `execute`). With `resolve`, * output is normalized under the name of the entry each call resolves to, so * an error from a call through `execute` names the entry, and a tool stub * matches that entry and its input, as it would a direct call. */ export declare function wrapToolExecute(definition: HarnessToolDefinition, resolve?: CallResolver): ((input: any, options: ToolExecuteOptions) => Promise | AsyncIterable) | undefined; /** * Builds the AI SDK ToolSet for one harness step. * * Most tools have local executors and are assembled by {@link buildToolSet}. * Provider-managed tools (e.g. web_search) have no local `execute` — the * execution layer intentionally omits it. This function detects the gap and * injects the real AI SDK provider tool in their place. * If the current model cannot supply that provider tool, the framework * sentinel is removed instead of being exposed as an unexecutable tool. * * When a user overrides a provider-managed tool via `defineTool()`, their * tool has a real executor and flows through the normal path — no * replacement occurs. * * Tool names listed in `disabledProviderTools` are skipped entirely — * both the framework definition and the injected provider tool are * omitted from the returned set. Used by the harness recovery path when * a gateway fallback provider has rejected a provider-specific tool. */ export declare function buildToolSetWithProviderTools(input: { readonly describe: (definition: HarnessToolDefinition) => string; readonly disabledProviderTools?: ReadonlySet; readonly profile: ModelProfile; readonly resolve: CallResolver; readonly tools: HarnessToolMap; }): Promise; /** * Builds the AI SDK 7 call-level approval policy: each call is approved by the * entry it runs, under that entry's name and with its own input. */ export declare function buildToolApproval(input: { readonly abortSignal?: AbortSignal; readonly approvedTools: ReadonlySet; readonly resolve: CallResolver; }): ToolApprovalConfiguration>; /** * Re-runs a tool's approval policy for a call a person approved, just before eve runs it, so the * policy can still refuse it, as when the connection it was approved against changed. */ export declare function recheckApprovedCall(definition: HarnessToolDefinition, call: { readonly callId: string; readonly input: unknown; readonly abortSignal?: AbortSignal; readonly approvedTools?: ReadonlySet; }): Promise<{ readonly denied: boolean; readonly reason?: string; }>;