import type { AdapterContext } from "../../hub/types/chat-envelope.js";
import type { JsonObject } from "../../hub/types/json.js";
type RequestMessagesRule = {
    when?: {
        role?: "system" | "user" | "assistant" | "tool";
        hasToolCalls?: boolean;
    };
    action: "drop" | "keep" | "set";
    set?: Record<string, unknown>;
};
export interface FilterConfig {
    request: {
        allowTopLevel: string[];
        messages: {
            allowedRoles: string[];
            assistantWithToolCallsContentNull?: boolean;
            toolContentStringify?: boolean;
            suppressAssistantToolCalls?: boolean;
        };
        tools?: {
            normalize?: boolean;
            forceToolChoiceAuto?: boolean;
        };
        assistantToolCalls?: {
            functionArgumentsType?: "object" | "string";
        };
        messagesRules?: RequestMessagesRule[];
    };
    response: {
        allowTopLevel: string[];
        choices: {
            required?: boolean;
            message: {
                allow: string[];
                roleDefault?: string;
                contentNullWhenToolCalls?: boolean;
                tool_calls?: {
                    function?: {
                        nameRequired?: boolean;
                        argumentsType?: "object" | "string";
                    };
                };
            };
            finish_reason?: string[];
        };
        usage?: {
            allow: string[];
        };
    };
}
export declare class UniversalShapeFilter {
    private readonly cfg;
    constructor(config: FilterConfig);
    applyRequestFilter(payload: JsonObject): JsonObject;
    applyResponseFilter(payload: JsonObject, ctx?: AdapterContext): JsonObject;
}
export {};
