import { z } from 'zod'; import type { OpenAPIV3 } from 'openapi-types'; import type { ActionMetadata, ActionMetadataRuntime } from './types/agents'; import type { FunctionTool, Schema, Reference } from './types/assistants'; import { AuthorizationTypeEnum } from './types/agents'; export type ParametersSchema = { type: string; properties: Record; required: string[]; additionalProperties?: boolean; }; export type OpenAPISchema = OpenAPIV3.SchemaObject & ParametersSchema & { items?: OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject; }; export type ApiKeyCredentials = { api_key: string; custom_auth_header?: string; authorization_type?: AuthorizationTypeEnum; }; export type OAuthCredentials = { tokenUrl: string; clientId: string; clientSecret: string; scope: string; }; export type Credentials = ApiKeyCredentials | OAuthCredentials; export declare function sha1(input: string): string; export declare function createURL(domain: string, path: string): string; /** * Class representing a function signature. */ export declare class FunctionSignature { name: string; description: string; parameters: ParametersSchema; strict: boolean; constructor(name: string, description: string, parameters: ParametersSchema, strict?: boolean); toObjectTool(): FunctionTool; } declare class RequestConfig { readonly domain: string; readonly basePath: string; readonly method: string; readonly operation: string; readonly isConsequential: boolean; readonly contentType: string; readonly parameterLocations?: Record | undefined; constructor(domain: string, basePath: string, method: string, operation: string, isConsequential: boolean, contentType: string, parameterLocations?: Record | undefined); } declare class RequestExecutor { private config; path: string; params?: Record; private operationHash?; private authHeaders; private authToken?; constructor(config: RequestConfig); setParams(params: Record): this; setAuth(metadata: ActionMetadataRuntime): Promise; execute(options?: { httpAgent?: unknown; httpsAgent?: unknown; }): Promise> | import("axios").AxiosResponse, {}, Record>>; getConfig(): RequestConfig; } export declare class ActionRequest { private config; constructor(domain: string, path: string, method: string, operation: string, isConsequential: boolean, contentType: string, parameterLocations?: Record); get domain(): string; get path(): string; get method(): string; get operation(): string; get isConsequential(): boolean; get contentType(): string; createExecutor(): RequestExecutor; setParams(params: Record): RequestExecutor; setAuth(metadata: ActionMetadata): Promise; execute(): Promise> | import("axios").AxiosResponse, {}, Record>>; } export declare function resolveRef(obj: T, components?: OpenAPIV3.ComponentsObject): Exclude; /** * Converts an OpenAPI spec to function signatures and request builders. */ export declare function openapiToFunction(openapiSpec: OpenAPIV3.Document, generateZodSchemas?: boolean): { functionSignatures: FunctionSignature[]; requestBuilders: Record; zodSchemas?: Record; }; export type ValidationResult = { status: boolean; message: string; spec?: OpenAPIV3.Document; serverUrl?: string; }; /** * Extracts domain from URL (protocol + hostname). * @param url - URL to extract from * @returns Protocol and hostname (e.g., "https://example.com") */ export declare function extractDomainFromUrl(url: string): string; export type DomainValidationResult = { isValid: boolean; message?: string; normalizedSpecDomain?: string; normalizedClientDomain?: string; }; /** * Validates client domain matches OpenAPI spec server URL domain (SSRF prevention). * @param clientProvidedDomain - Domain from client (with/without protocol) * @param specServerUrl - Server URL from OpenAPI spec * @returns Validation result with normalized domains */ export declare function validateActionDomain(clientProvidedDomain: string, specServerUrl: string): DomainValidationResult; /** * Validates and parses an OpenAPI spec. */ export declare function validateAndParseOpenAPISpec(specString: string): ValidationResult; export {};