import { z } from "genkit"; import { GenkitBeta } from "genkit/beta"; import { FGAAuthorizerBase } from "@auth0/ai/FGA"; import { ToolDefinition, ToolWrapper } from "./lib"; type FGAAIParams = { fga?: ConstructorParameters[0]; genkit: GenkitBeta; }; type FGAParams = ConstructorParameters[1]; /** * A class for integrating Fine-Grained Authorization with AI tools. * * This class provides functionality to wrap AI tools with FGA authorization controls. * It allows for authorization checks to be applied to AI tools before they are used. * * @example * ```typescript * const fgaAI = new FGA_AI({ * fga: { * apiUrl: 'https://api.fga.example', * storeId: 'store123', * credentials: { ... } * }, * genkit: ai * }); * * // Wrap an existing tool * const authorizedTool = fgaAI.withFGA({ * buildQuery: async ({userID, doc}) => ({ user: userID, object: doc, relation: 'read' }) * }, myAITool); * * // Or create a wrapper to apply to tools later * const authorizer = fgaAI.withFGA({ * buildQuery: async ({userID, doc}) => ({ user: userID, object: doc, relation: 'read' }) * }); * const authorizedTool = authorizer(myAITool); * ``` */ export declare class FGA_AI { private fgaParams; constructor(fgaParams: FGAAIParams); /** * * Returns a tool authorizer that protects the tool execution * with the Fine Grained Authorization (FGA) authorization control. * * @param params - The parameters for the FGA authorization control. * @returns A tool authorizer. */ withFGA(params: FGAParams): ToolWrapper; /** * * Protects a tool function with Fine Grained Authorization (FGA) authorization control. * * @param params - The parameters for the FGA authorization control. * @param tool - The tool to protect. * @returns The protected tool. */ withFGA(params: FGAParams, toolConfig?: ToolDefinition[0], toolFn?: ToolDefinition[1]): ToolDefinition; } export {}; //# sourceMappingURL=FGA_AI.d.ts.map