import type { JSONSchema7 } from 'json-schema'; import { z } from 'zod'; import type { BuiltTool, InterruptibleToolContext, ToolContext } from '../types'; import type { AgentMessage } from '../types/sdk/message'; import type { ToolDescriptor } from '../types/sdk/tool-descriptor'; import type { JSONObject } from '../types/utils/json'; export declare const APPROVAL_SUSPEND_SCHEMA: z.ZodObject<{ type: z.ZodLiteral<"approval">; toolName: z.ZodString; displayName: z.ZodOptional; args: z.ZodUnknown; }, "strip", z.ZodTypeAny, { type: "approval"; toolName: string; displayName?: string | undefined; args?: unknown; }, { type: "approval"; toolName: string; displayName?: string | undefined; args?: unknown; }>; export type ApprovalSuspendPayload = z.infer; export declare const APPROVAL_RESUME_SCHEMA: z.ZodObject<{ approved: z.ZodBoolean; }, "strip", z.ZodTypeAny, { approved: boolean; }, { approved: boolean; }>; export type ApprovalResumePayload = z.infer; type ZodOrJsonSchema = z.ZodType | JSONSchema7; type OutputType = TOutput extends z.ZodType ? z.infer : unknown; export interface ApprovalConfig { requireApproval?: boolean; needsApprovalFn?: (args: unknown) => Promise | boolean; } export declare function getToolApprovalDisplayName(tool: BuiltTool): string | undefined; export declare function wrapToolForApproval(tool: BuiltTool, config: ApprovalConfig): BuiltTool; type HandlerContext = S extends z.ZodType ? R extends z.ZodType ? InterruptibleToolContext, z.infer> : ToolContext : ToolContext; export declare class Tool { private name; private desc?; private inputSchema?; private outputSchema?; private suspendSchemaValue?; private resumeSchemaValue?; private handlerFn?; private toMessageFn?; private toModelOutputFn?; private providerOptionsValue?; private handleCancellationValue?; private requireApprovalValue?; private needsApprovalFnValue?; private systemInstructionText?; constructor(name: string); description(desc: string): this; systemInstruction(text: string): this; input(schema: S): Tool; output(schema: S): Tool; suspend(schema: S): Tool; resume(schema: R): Tool; handler(fn: (input: OutputType, ctx: HandlerContext) => Promise>): this; toMessage(toMessage: (output: OutputType) => AgentMessage): this; toModelOutput(fn: (output: OutputType) => unknown): this; handleCancellation(): this; requireApproval(): this; needsApprovalFn(fn: (args: OutputType) => Promise | boolean): this; providerOptions(options: Record): this; build(): BuiltTool; describe(): ToolDescriptor; } export declare function sanitizeToolName(name: string): string; export {};