import type { ValidateFunction } from 'ajv';
import type Ajv from 'ajv';
import type { ActorInfo, ActorInputSchema, ActorInputSchemaProperties, SchemaProperties } from '../types.js';
export declare function isActorInfoMcpServer(actorInfo: ActorInfo): boolean;
export declare function actorNameToToolName(actorName: string): string;
export declare function getToolSchemaID(actorName: string): string;
export declare function fixedAjvCompile(ajvInstance: Ajv, schema: object): ValidateFunction<unknown>;
/**
 * Builds nested properties for object types in the schema.
 *
 * Specifically handles special cases like proxy configuration and request list sources
 * by adding predefined nested properties to these object types.
 * This is necessary for the agent to correctly infer how to structure object inputs
 * when passing arguments to the Actor.
 *
 * For proxy objects (type='object', editor='proxy'), adds 'useApifyProxy' property.
 * For request list sources (type='array', editor='requestListSources'), adds URL structure to items.
 *
 * @param {Record<string, SchemaProperties>} properties - The input schema properties
 * @returns {Record<string, SchemaProperties>} Modified properties with nested properties
 */
export declare function buildApifySpecificProperties(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
/**
 * Filters schema properties to include only the necessary fields.
 * This is done to reduce the size of the input schema and to make it more readable.
 * @param properties
 */
export declare function filterSchemaProperties(properties: {
    [key: string]: SchemaProperties;
}): {
    [key: string]: SchemaProperties;
};
/**
 * For array properties missing items.type, infers and sets the type using inferArrayItemType.
 * @param properties
 */
export declare function inferArrayItemsTypeIfMissing(properties: {
    [key: string]: SchemaProperties;
}): {
    [key: string]: SchemaProperties;
};
/**
 * Marks input properties as required by adding a "REQUIRED" prefix to their descriptions.
 * Takes an ActorInput object and returns a modified Record of SchemaProperties.
 *
 * This is done for maximum compatibility in case where library or agent framework does not consider
 * required fields and does not handle the JSON schema properly: we are prepending this to the description
 * as a preventive measure.
 * @param {ActorInputSchema} input - Actor input object containing properties and required fields
 * @returns {Record<string, SchemaProperties>} - Modified properties with required fields marked
 */
export declare function markInputPropertiesAsRequired(input: ActorInputSchema): Record<string, SchemaProperties>;
/**
 * Builds the final Actor input schema for MCP tool usage.
 */
export declare function buildActorInputSchema(actorFullName: string, input: ActorInputSchema | undefined, isRag: boolean): {
    inputSchema: ActorInputSchema;
};
/**
 * Returns a shallow-cloned input schema that keeps only whitelisted properties
 * and filters the required array accordingly. All other top-level fields are preserved.
 * If properties are missing, the original input is returned unchanged.
 *
 * This is used specifically for apify/rag-web-browser where we want to expose
 * only a subset of input properties to the MCP tool without redefining the schema.
 */
export declare function pruneSchemaPropertiesByWhitelist(input: ActorInputSchema, whitelist: Iterable<string>): ActorInputSchema;
/**
 * Helps determine the type of items in an array schema property.
 * Priority order: explicit type in items > prefill type > default value type > editor type.
 *
 * Based on JSON schema, the array needs a type, and most of the time Actor input schema does not have this, so we need to infer that.
 *
 */
export declare function inferArrayItemType(property: SchemaProperties): string | null;
/**
 * Add enum values as string to property descriptions.
 *
 * This is done as a preventive measure to prevent cases where library or agent framework
 * does not handle enums or examples based on JSON schema definition.
 *
 * https://json-schema.org/understanding-json-schema/reference/enum
 * https://json-schema.org/understanding-json-schema/reference/annotations
 *
 * @param properties
 */
export declare function addEnumsToDescriptionsWithExamples(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
/**
 * Helper function to filter and shorten the enum list.
 * Removes empty strings and truncates if the total character count exceeds the limit.
 *
 * @param {string[]} enumList - The list of enum values to be filtered and shortened.
 * @returns {string[] | undefined} - The filtered and shortened enum list or undefined if the list is too long.
 */
export declare function filterAndShortenEnum(enumList: string[]): string[] | undefined;
/**
 * Shortens the description, enum, and items.enum properties of the schema properties.
 * This is mostly problem with compass/crawler-google-places, which has large number of categories
 * such as ( 'abbey', 'accountant', 'accounting',  'acupuncturist', .... )
 * @param properties
 */
export declare function shortenProperties(properties: {
    [key: string]: SchemaProperties;
}): {
    [key: string]: SchemaProperties;
};
/**
 * Fixes dot notation in the property names of schema properties.
 *
 * Some providers, such as Anthropic, allow only the following characters in property names: `^[a-zA-Z0-9_-]{1,64}$`.
 *
 * @param properties - The schema properties to fix.
 * @returns {Record<string, SchemaProperties>} The schema properties with fixed names.
 */
export declare function encodeDotPropertyNames(properties: Record<string, SchemaProperties>): Record<string, SchemaProperties>;
/**
 * Restores original property names by replacing '-dot-' with '.'.
 *
 * This is necessary to decode the property names that were encoded to avoid issues with providers
 * that do not allow dots in property names.
 *
 * @param properties - The schema properties with encoded names.
 * @returns {Record<string, SchemaProperties>} The schema properties with restored names.
 */
export declare function decodeDotPropertyNames(properties: Record<string, unknown>): Record<string, unknown>;
export declare function transformActorInputSchemaProperties(input: Readonly<ActorInputSchema>): ActorInputSchemaProperties;
//# sourceMappingURL=utils.d.ts.map