import { GenkitBeta, ToolRequestPart, z } from "genkit/beta"; import { ContextGetter } from "@auth0/ai/authorizers"; import { Auth0Interrupt } from "@auth0/ai/interrupts"; import { ToolAction, ToolConfig, ToolFn, ToolFnOptions, ToolRunOptions } from "@genkit-ai/ai/tool"; export type ToolWrapper = (...t: ToolDefinition) => ToolDefinition; export type ToolDefinition = [ config: ToolConfig, fn: ToolFn ]; type TProtectFunc = (getContext: ContextGetter<[any, ToolFnOptions & ToolRunOptions]>, execute: (args_0: any, args_1: ToolFnOptions & ToolRunOptions) => any) => (args_0: any, args_1: ToolFnOptions & ToolRunOptions) => any; export declare const createToolWrapper: (genkit: GenkitBeta, protect: TProtectFunc) => ToolWrapper; export declare const toGenKitInterrupt: (err: Auth0Interrupt) => never; /** * * Build a list of GenKit restart confirmations from the * Auth0 interrupted tool requests. * * @param tools - The list of tools that are used in the session. * @param interruptedToolRequests - The list of interrupted tool requests. * @returns A list of GenKit restart confirmations. */ export declare const getAuth0Confirmations: (tools: ToolAction[], ...interruptedToolRequests: (ToolRequestPart | undefined)[]) => { toolRequest: { name: string; ref?: string | undefined; input?: unknown; }; metadata?: Record | undefined; custom?: Record | undefined; text?: undefined; media?: undefined; toolResponse?: undefined; data?: unknown; reasoning?: undefined; resource?: undefined; }[]; /** * Builds the resume function for the Auth0 interrupted tool requests. * Use this function only if you don't expect other type of interrupts * besides Auth0 authorizers. * * Otherwise use `getAuth0Confirmations` to get the list of confirmations. * * @param tools - The list of tools that are used in the session. * @param interruptedToolRequests - The list of interrupted tool requests. * @returns - The resume for the Auth0 interrupted tool requests. */ export declare const resumeAuth0Interrupts: (tools: ToolAction[], ...interruptedToolRequests: (ToolRequestPart | undefined)[]) => { restart: { toolRequest: { name: string; ref?: string | undefined; input?: unknown; }; metadata?: Record | undefined; custom?: Record | undefined; text?: undefined; media?: undefined; toolResponse?: undefined; data?: unknown; reasoning?: undefined; resource?: undefined; }[]; } | undefined; export {}; //# sourceMappingURL=index.d.ts.map